Problème g++

Pierre -  
 Pierre -
Salut,
j'ai un problème avec mon g++, je me crée un programme test :
#include <iostream>
int main()
{
cout << "test\n";
}

Je l'enregistre sous test.cpp .
Là je tappe g++ test.cpp et il me marque :

test.cpp: Dans function << int main() >>:
test.cpp:4 error: `cout' undeclared (first use this function)
test.cpp:4 error: (Each undeclared identifier is reported only once for each function it appears in.)

Donc je ne comprend pas, si quelqu'un peu l'aider svp.

2 réponses

  1. Ravachol Messages postés 568 Statut Membre 120
     
    Salut.
    Essaie en mettant
    std::cout << "test" << std::endl;
    

    Ou bien en inserant
    using namespace std;
    

    avant int main()

    A++

    La pensée ne commence qu'avec le doute.
    ROGER MARTIN DU GARD
    0
  2. Pierre
     
    Merci, c'etait juste ça !
    Ca m'etait completement sortit de la tete .
    0