Retourner au contenu associé (entrée de forum : String.h)
Posté par omnikron le 15 juin 2007 à 12:01. En réponse au message String.h. Évalué à 1.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# namespace ?
Posté par omnikron . En réponse au message String.h. Évalué à 1.
#include
#include
using namespace std;
int main(int argc, char **argv) {
string toto = "hello world\n";
cout << toto;
return 0;
}
Et compile avec g++ -Wall -o plop plop.cpp
La chose importante est using namespace std;
Sans cette ligne tu devrait écrire :
#include
#include
int main(int argc, char **argv) {
std::string toto = "hello world\n";
std::cout << toto;
return 0;
}