我收到此错误:
arthur@arthur-VirtualBox:~/Desktop$ gcc -o hw -ansi hw1.c
hw1.c: In function `main':
hw1.c:27:16: warning: assignment makes pointer from integer without a cast [enabled by default]
hw1.c: At top level:
hw1.c:69:7: error: conflicting types for `randomStr'
hw1.c:27:18: note: previous implicit declaration of `randomStr' was here
编译此代码时:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
char *rndStr;
rndStr = randomStr(FILE_SIZE);
/* Do stuff */
return 0;
}
/*Generate a random string*/
char* randomStr(int length)
{
char *result;
/*Do stuff*/
return result;
}
如果我切换它的功能顺序,为什么?