ostream dans .h

ostream dans .h

by Naïla Haldy -
Number of replies: 3

Bonjour,

J'ai un problème avec mon makefile, dans un .h au niveau d'une fonction qui prend un ostream en paramètre (Fonction qui me sert à définir l'opérateur d'affichage).

Le compilateur m'indique error : "ostream" has not been declared

Comment remédier à ça ? 

Merci !



In reply to Naïla Haldy

Re: ostream dans .h

by Augustin Jean Robert Pelletier -

Il faut écrire std:: devant chaque ostream du .h, sauf erreur.

In reply to Augustin Jean Robert Pelletier

Re: ostream dans .h

by Naïla Haldy -
Ah super merci ! Par contre maintenant j'ai toujours un problème avec l'opérateur d'affichage : error : no match for "operator<<" Sa définition est dans le .cc, sans prototype dans le .h C'est bien correct ?