Mail Archives: djgpp/1999/11/26/13:17:27
cavgp AT aol DOT com (CAVGP) writes:
> Hello there,
> cout << ("The number entered was" << x << "and" << y << "\n");
you have to leave out the brackets:
cout << "The number entered was" << x << "and" << y << "\n";
that's afaik because without explicit parentheses the expression
is evaluated in the other order:
((((cout << "The number entered was") << x) << "and") << y) << "\n";
(if you don't know what that means, simply leave out the parentheses)
> 2)undefined reference to cin 'istream:: operator >> (int&)
> cin >> a;
I'm not quite sure, have you tried to pass a pointer to an int to
operator>> (printf-style ;-)?
this works:
int a;
cin >> a;
> Are cout and cin still valid using the new GCC from 2.95.2?,, and
the short answer is yes,
the long is afaik that there has been a new standard accepted,
and gcc currently implements the old one
good luck
--
Felix Natter
- Raw text -