Ich fang erst an C zu lernen, aber kann mir trotzdem das erklären?
Hab nur irgend eine ganz einfache Rechnung eingetippt, und wüsst da einfach keinen Fehler.
#include <stdio.h>
#include <math.h>
const couble PI = 3.41
main()
{
double radius ist 10;
double flaechehalbkreis;
double flaecheviertelkreis;
flaechehalbkreis = radius * radius * PI / 2; //zeile 29
printf("A vom halben Kreis: %g/n", flaechehalbkreis);
printf("A vom viertel ... : %g/n", flaecheviertelkreis);
}
main.c:23:error: parse error before "main"
29:Warnung:type defaults to 'int' in declaration of flaechehalbkreis'
29:error:conflicting types for 'flaeche Halbkreis'
26:error
revious declaration of 'flaechehalbkreis'
29:error:'radius'undeclared here(not in function)
29:Warnung:data definition has no type or storage class
31:Warnung:type defaults to 'int' in declaration of 'flaecheviertelkreis'
31:error:conflicting types for 'flaecheviertelkreis'
27:error
revious declaration of 'flacheviertelkreis'
31:Warnung: data definition has no type or storage class
33:Warnung:type defaults to 'int' in declaration of 'printf'
33:Warnung:conflicting types for built-in function 'printf'
33:Warnung:data defintion has no type or storage class
34:error parse: error before string constant
34:Warnung:type defaults to 'int' in declaration of 'printf'
34:Warnung:data definition has no type or storage class
gmake:*** [main.o]Fehler1
Hab nur irgend eine ganz einfache Rechnung eingetippt, und wüsst da einfach keinen Fehler.
#include <stdio.h>
#include <math.h>
const couble PI = 3.41
main()
{
double radius ist 10;
double flaechehalbkreis;
double flaecheviertelkreis;
flaechehalbkreis = radius * radius * PI / 2; //zeile 29
printf("A vom halben Kreis: %g/n", flaechehalbkreis);
printf("A vom viertel ... : %g/n", flaecheviertelkreis);
}
main.c:23:error: parse error before "main"
29:Warnung:type defaults to 'int' in declaration of flaechehalbkreis'
29:error:conflicting types for 'flaeche Halbkreis'
26:error
29:error:'radius'undeclared here(not in function)
29:Warnung:data definition has no type or storage class
31:Warnung:type defaults to 'int' in declaration of 'flaecheviertelkreis'
31:error:conflicting types for 'flaecheviertelkreis'
27:error
31:Warnung: data definition has no type or storage class
33:Warnung:type defaults to 'int' in declaration of 'printf'
33:Warnung:conflicting types for built-in function 'printf'
33:Warnung:data defintion has no type or storage class
34:error parse: error before string constant
34:Warnung:type defaults to 'int' in declaration of 'printf'
34:Warnung:data definition has no type or storage class
gmake:*** [main.o]Fehler1