Hallo, hab meine erste eigene Headerdatei zur Probe geschrieben, leider
kann ich diese nicht kompilieren. Meine Frage ist nun, hab ich irgendwas
falsch gemacht oder vergessen. Hier ma der Text:
#ifndef MULTI_HPP
#define MULTI_HPP
float mul(float x,float y)
#endif
----------------------------------------------------
#include "multi.hpp"
float mul(float x,float y)
{
return (x*y);
}
----------------------------------------------------
#include <cstdlib>
#include <iostream>
#include "multi.hpp"
using namespace std;
int main(int argc, char *argv[])
{
float a = 5;
float b = 5;
float c = mul(a,b);
system("PAUSE");
return EXIT_SUCCESS;
}
---------------------------------
Fehler:
expectet init-declarator before "float"
Build Error multi.o
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.