即使在加入<stdlib.h>
warning: incompatible implicit declaration of built-in function ‘exit’
有人知道它为什么给予?
void Check_file(char *filepath)
{
if(access( filepath, F_OK ) == -1 ) {
printf("\nUnable to access : %s\n",filepath);
exit(1);
}
return;
}
答案 0 :(得分:1)
提供正确的包含文件时,您的程序compiles without complaint。
#include <stdio.h> /* needed for printf */
#include <stdlib.h> /* needed for exit */
#include <unistd.h> /* needed for access and F_OK */
void Check_file(char *filepath)
{
if(access( filepath, F_OK ) == -1 ) {
printf("\nUnable to access : %s\n",filepath);
exit(1);
}
return;
}
int main () { return 0; }