2016-03-01 129 views
1

我很無聊「內置函數‘退出’的不兼容的隱式聲明」,於是我開始研究新的東西,在這種情況下,C「LD返回1個退出狀態」和

我試圖在c中做一個基本的腳本,但我有這個錯誤,我不知道什麼是錯的。

//Tablas 

#include <stdio.h> 

int main() { 

    double i, j, p; 
    int x, y; 

    printf ("Tablas del: "); 
    scanf ("%i", &x); 
    printf ("Hasta el: "); 
    scanf ("%i", &y); 

    FILE *f; 
    f = fopen("Tablas.txt", "w"); 
    if (f == NULL) { 
     printf("No se ha podido abrir/crear/reemplazar el archivo\n\a"); 
     exit(1); 
    } 

    printf ("Espere mientras se calcula los resulatdos.\n"); 
    system ("del tablas.txt"); 

    for (i = x ; i <= y ; i++) { 
     for (j = x ; j <= 10 ; j++) { 
      fprinf(f, "%f x %f = %f\n", i, j, i*j); 
     } 
    } 
    printf ("\nFin\n\a"); 
    system ("pause"); 
    return 0; 
} 
+0

delete this('system(「del tablas.txt」);')line。 – BLUEPIXY

回答

1

你需要#include <stdlib.h>exit工作。

+0

是的,那修復一件事,但仍然給我的LD返回1退出狀態錯誤 –

+4

好吧,所以還有一個錯誤,你的'fprinf'應該是'fprintf' - 注意細節 – artm

相關問題