我有一个为我设置的程序,我只需填写空格。底部有一个函数,我不必触摸,但不明白为什么函数的返回类型是char*
,而不仅仅是char
。char *做什么或作为函数的返回类型?
/*Main Function from where it is called */
char * check(char * name, double sx[], double t[], int n);
/*Function*/
char * check(char * name, double sx[], double t[], int n)
{
int i;
for(i = 0 ; i < n ; i++)
{
if(fabs(sx[i] - t[i]) > EPSILON)
return (strcat(name, " check fails"));
else
return (strcat(name, " check is OK"));
}
}
我不明白这是为什么。