conio.h该头文件主要包含什么?streat( , )为什么用不了?
/*VC++ 6.0*/#include<iostream.h>
#include<conio.h>/////////////该头文件主要包含什么?////////////////
#include<string.h>
template <class T>
T Sum(T* array,int size=0)
{
T total=0;
for(int i;i<size;i++)
total+=arry[i];
return total;
}
template <class T1,class T2>
T2 Sum(T1 *array1,T2 *array2,int size=0)
{
static T2 total;
for(int i;i<size;i++)
total+=arry[i]+arry2[i];
return total;
}
char * Sum(char *s1,char *s2)
{
return streat(s1,s2);///////////error C2065: 'streat' : undeclared identifier/////////////
}
int Intarr[]={1,2,3,4,5,6,7,8,9,10};
double Douarr[]={1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10};
void main()
{
int itotal=Sum(Intarr,10);
char *p="hello";
char *p1="world";
p=Sum(p,p1);
double dtotal=Sum(Douarr,120);
double dtotal1=Sum(Intarr,Douarr,10);
cout<<"The summary of integer array is: "<<itotal<<endl;
cout<<"The summary of double floating array is: "<<dtotal<<endl;
cout<<"The summary of two arrays is: "<<dtotal1<<endl;
cout<<"The summary of two strings is: "<<p<<endl;
}