-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