求助,找不出问题在哪
#include <stdio.h>#define M 10
#define B 4
void setstar (char*,int);
void arrout(char*,int);
main()
{ char c[M]={'A','B','C','D','E','F','G','H','I','J'};
setstar(&c[4],M-B);
arrout(c,M);
}
void setstar(char*t,int n)
{ int i;
for(i=0;i<n;i++)
*(t+i)='*';
}
void arrout(char*t,int n)
{
int i;
for(i=0;i<n;i++)
printf("%c",c[i]);
printf("\n");
}
一直显示F:\c++\dr\dddddda.cpp(10) : warning C4508: 'main' : function should return a value; 'void' return type assumed
F:\c++\dr\dddddda.cpp(20) : error C2065: 'c' : undeclared identifier
F:\c++\dr\dddddda.cpp(20) : error C2109: subscript requires array or pointer type