Declaration syntax error
-
Hallo,
also ich habe ein programm geschrieben und will dieses kompillieren. Nur bekomm ich jetzt eine Fehlermeldung: Error E2141 spiegeln.cpp 6: Declaration syntax error.
Die ersten paar zeilen meines programms gehen so:
#include <iomanip.h>
#include <iostream.h>
#include <ctype.h>
int berechnen (int ax, int ay, int xx, int xy)
void main (){
char antwort;wo soll dort der fehler sein???
Schonmal danke im vorraus
C++Freak
p.s ich bin noch anfänger also bitte ausführlich erklären
thx
-
C++Freak schrieb:
int berechnen (int ax, int ay, int xx, int xy)
Da hast du ein Semikolon vergessen nach der Deklaration.
-
C++Freak schrieb:
wo soll dort der fehler sein???
Die Frage sollte eher lauten, wo kein Fehler ist. Das liesse sich kürzer beantworten.
#include <iomanip> #include <iostream> #include <cctype> int berechnen (int ax, int ay, int xx, int xy); int main (){ char antwort;
Warum? Nun, das sind die aktuellen Standard Header Dateien (siehe dazu std Namensraum) und main muss int zurückgeben.