-6
我是Ubuntu的新手,我正在学习关于在C编程中学习的FILE。我写了我的代码,但是我不能运行它们,因为它想要我另一个库。那么,哪个库包含FILE?我只使用#include <stdio.h>
,但在ubuntu中有点不同。我需要一个库名
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *ptrFILE;
if(ptrFILE = fopen("Test.txt","w")==NULL)
{
printf("The file couldn't opened\n");
}
else
{
int i;
for(i=1; i<=20; i++)
{
fprintf(fptrFILE,"%d\n", i*5);
}
fclose(ptrFILE);
return 0;
}
你包括? –
你使用什么编译器?你是否正确安装? – usr2564301
您的代码是否成功编译,但无法链接? – donjuedo