• # namespace ?

    Posté par . En réponse au message String.h. Évalué à 1.

    Ce que tu raconte m'étonne beaucoup... On ne sait jamais mais pense d'abord à un problème d'accès au namespace "std". Essaie le code suivant :

    #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;
    }