[英]GCC |warning: implicit declaration of function '_stricmp' [-Wimplicit-function-declaration]|
[英]warning: implicit declaration of function ‘strcpy’ [-Wimplicit-function-declaration] the program work but how i fix the compiler error
struct student * createStudent(char studentName[],int studentAge){
struct student * ptr;
ptr= (struct student *)malloc(sizeof(struct student));
strcpy(ptr->name,studentName);
ptr->age=studentAge;
ptr->next=NULL;
return ptr;
}
Compilation result: 60663645638018396.c: In function 'createStudent': 60663645638018396.c:46:5: warning: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration] strcpy(ptr->name,studentName); ^ 60663645638018396.c:46:5:警告:內置 function 'strcpy' 的隱式聲明不兼容
該程序正在運行,但我不明白編譯錯誤是什么。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.