简单template 的问题
#include <iostream.h>template <class T>
void printArray(const T *array, const int count);
{// 错误信息出现在这边
for (int i = 0; i<count; i++)
cout<<array[i]<<" ";
cout<<endl;
}
int main(){
const int aCount =5,bCount = 7,cCount = 6;
int a[aCount] = {1,2,3,4,5};
double b[bCount] = {1.1,2.2,3.3,4.4,5.5,6.6,7.7};
char c[cCount] = "HELLO";
cout<<"Array a contains";
printArray (a,aCount);
cout<<"Array b contains";
printArray(b,bCount);
cout<<"Array c contains";
printArray(c,cCount);
return 0;
}
C:\Documents and Settings\People\tmpla.cpp(4) : error C2447: missing function header (old-style formal list?)
谢谢了