J
JustSomeGuy
why would cout << '<' print 62
and cout << '>' print 60
Is there some flag that I have clobbered?
and cout << '>' print 60
Is there some flag that I have clobbered?
JustSomeGuy said:why would cout << '<' print 62
and cout << '>' print 60
Is there some flag that I have clobbered?
why would cout << '<' print 62
and cout << '>' print 60
Is there some flag that I have clobbered?
adbarnet said:'<' is character code 62, and '>' is character code 60 - the stream operator
just sees them as ints - cout << "<" would work.
ad
Sorry I obviously haven't posted all the code here..
but when I try
cout << "<"
it prints out the address of the "<" string.
JustSomeGuy said:why would cout << '<' print 62
and cout << '>' print 60
Is there some flag that I have clobbered?
Jeremy A. Smith said:I"m new here and this may be an obvious statement, but what it looks like
it's priniting is the ascii values for "<" and ">"
JustSomeGuy said:Sorry I obviously haven't posted all the code here..
but when I try
cout << "<"
it prints out the address of the "<" string.
JustSomeGuy said:Sorry I obviously haven't posted all the code here..
but when I try
cout << "<"
it prints out the address of the "<" string.
msalters said:That's the obvious giveaway. You're getting the member
operator<<(void*) not the non-member operator(char*) because
your <iostream> does not include <ostream> (that's legal, but
uncommon - hence many people forget <ostream> )
Regards,
Michiel Salters
Rob said:Are you including <ostream> ?
#include <iostream> /* for std::cout */
#include <ostream> /* for the << operators & std::endl */
Arijit said:You have to include ostream separately ?! I didn't know that. I have
never had to do it even once. And I have used quite a few compilers.
Plain lucky ?
JustSomeGuy said:Ok I tried including <ostream> that didn't help...
however delving deeper into this class I found that it is inheriting from
std::streambuf and has a overflow method... and I'm thinking that somehow
to_char_type is not being called somehow.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.