Frage Fehlermeldung
-
Hallo leute ich habe folgendes header file erzeugt :
#ifndef CSTUDENT_H_ #define CSTUDENT_H_ #include <string> class CStudent { private: int m_numMatr; string m_firstname; string m_surname; CStudent( string surname = "NoName",string firstname = "NoName",int numMatr = -1); CStudent( CStudent& orig); void print(); void setName( string firstname,string surname ); bool setNumMatr( int matr); friend ostream& operator (out stream&, CStudent& s); }; ostream& operator (out stream&, CStudent& s); #endif /* CSTUDENT_H_ */Mir wird folgender fehler angezeigt:
Type 'string' could not be resolved Semantic Error
Habt ihr tipps wie ich das problem beseitigen kann?
-
std::string
-
Ah danke .
Jetzt wird mir nur diese Fehlermeldung angezeigt:
Description Resource Path Location Type
'ostream' does not name a type CStudent.h /CStudent line 22 C/C++ ProblemWas stimmt da nicht?
Ich benutze eclipse
-
Versuch mal was aus der vorherigen Antwort zu lernen, vielleicht kommst du dann auf eine Lösung für dein neues Problem.
-
Tut mir leid ich bin noch Anfänger und komme jetzt einfach leider nicht drauf.
Kannst du es mir nicht sagen?
-
Und außerdem
#include <iostream>
-
Die Funktionen aus der Standardbibliothek befinden sich im Namensraum "std". Das musst du dem compiler sagen.
Also auch std::ostream.