| Subject: | Re: printf and cout |
|---|---|
| From: | Bernhard Schauer |
| Date: | Wed, 26 Mar 2008 10:01:13 +0100 |
| Newsgroups: | comp.lang.c |
> int c = 400;
> printf("%c", c);
>
> it print ? on screen, and ascii of '?' is 63.
>
> but
> cout << int(char(400));
>
> it print -112 on screen.
>
> so, my question is why comes 63 and -112, what relations between them,
> why printf and cout behavior so differently.
Hi!
both values are the same, except that the '?' is not meant as the
character '?' but as an unprintable character. It also "looks" different
than a normal '?'.
regards
--
Bernhard Schauer
schauer_at_cruxy_dot_net
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: printf and cout, Richard Heathfield |
|---|---|
| Next by Date: | Re: question on structures., broli |
| Previous by Thread: | Re: printf and cout, Mark McIntyre |
| Next by Thread: | Re: printf and cout, santosh |
| Indexes: | [Date] [Thread] [Top] [All Lists] |