
Aracon
Routinier
Also ich bin in der zwischnzeit am erweitern und bin bei Function angekommen:
#include <iostream.h>
// Funktion DemonstrationFunktion
// gibt eine Meldung aus
void DemonstrationFunction()
{
cout << "In DemonstationFunction\n" ;
}
// Funtion main - gibt eine meldung aus,
// ruft dann DemonstationFuntkion auf, gibt danach
// eine zweite Meldung aus.
int main()
{
cout << "In main\n" ;
DemonstrationFunction();
cout << "Zurueck in main\n";
return 0;
}
Der g++ wirft aber folgendes aus:
aracon@weapons-of-mass-destruction stunde2 $ g++ -o funktion1-funktion test.cpp
test.cpp: In function `void DemonstrationFunction()':
test.cpp:8: error: `cout' undeclared (first use this function)
test.cpp:8: error: (Each undeclared identifier is reported only once for each
function it appears in.)
Könnt ihr einem Armen cpp noob weiterhelfen?
Der Code ist mit dem Lehrbuch identisch (hoffe ich doch mal)
#include <iostream.h>
// Funktion DemonstrationFunktion
// gibt eine Meldung aus
void DemonstrationFunction()
{
cout << "In DemonstationFunction\n" ;
}
// Funtion main - gibt eine meldung aus,
// ruft dann DemonstationFuntkion auf, gibt danach
// eine zweite Meldung aus.
int main()
{
cout << "In main\n" ;
DemonstrationFunction();
cout << "Zurueck in main\n";
return 0;
}
Der g++ wirft aber folgendes aus:
aracon@weapons-of-mass-destruction stunde2 $ g++ -o funktion1-funktion test.cpp
test.cpp: In function `void DemonstrationFunction()':
test.cpp:8: error: `cout' undeclared (first use this function)
test.cpp:8: error: (Each undeclared identifier is reported only once for each
function it appears in.)
Könnt ihr einem Armen cpp noob weiterhelfen?

Der Code ist mit dem Lehrbuch identisch (hoffe ich doch mal)