Total members 9950 | Gratitudes |It is currently Sat Feb 11, 2012 2:22 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: i need help please
PostPosted: Mon May 04, 2009 12:20 am 
Offline
Newbie
User avatar

Joined: Sun May 03, 2009 11:36 pm
Posts: 1
Has thanked: 0 time
Have thanks: 0 time

i would like to know what is the output for this program.






#include <iostream>

using std::cout;
using std::endl;
using std::ios;
#include<new>

#include<iomanip>
//using std::fix;
using std::setprecision;

template < typename T >
class Array{
public:
Array(int=5);
~Array() {delete[] arrayPtr; }
T arrayRef(int)const;
int getsize() const;

private:
int size;
T *arrayPtr;
};
template< typename T>
Array< T >::Array(int x)
{
size=x;
arrayPtr[i] = 1.0 * i;
}
template<typename T>
T Array< T >::arrayRef(int num)const
{
return arrayPtr[num];
}
template< typename T >
int Array<T>::getSize() const
{
return getSize;
}
template <typename T >
void printArray(const Array<T> &a)
{
for (int i=0; i< a.getSize(); i++)
cout << a.arrayRef(i) << " ";
cout << endl << endl;
}
int main()
{
int fixed;
Array< int > intArray(4);
Array< double > doubleArray;

cout << setprecision(2);
printArray( intArray );
printArray( doubleArray);

return 0;
}


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: i need help please
PostPosted: Mon May 04, 2009 2:38 am 
Offline
Newbie
User avatar

Joined: Sat Nov 01, 2008 10:28 am
Posts: 20
Has thanked: 0 time
Have thanks: 0 time
okkk

_________________
http://www.vikneshblog.blogspot.com


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team