Problème g++

Fermé
Pierre - 5 sept. 2004 à 16:50
 Pierre - 5 sept. 2004 à 18:50
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

Ravachol Messages postés 560 Date d'inscription vendredi 5 mars 2004 Statut Membre Dernière intervention 30 octobre 2005 120
5 sept. 2004 à 17:02
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
Merci, c'etait juste ça !
Ca m'etait completement sortit de la tete .
0