cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
ternary operator question
ternary operator question
Nov 12, 2010 at 11:59pm UTC
Mr and Mrs D
(5)
foo ? bar = (true : false); //valid ?
also
foo ? cout << ("str" : "str2"); //valid ?
thanks :)
Nov 13, 2010 at 12:03am UTC
Bazzy
(6281)
no, it should be like
cout << ( foo ?
"str"
:
"str2"
);
( and similarly the other one )
Nov 13, 2010 at 12:12am UTC
Mr and Mrs D
(5)
Thanks :)
Topic archived. No new replies allowed.