On Fri, 2008-09-05 at 05:20 -0700, jt wrote:
Quote:
>
Bartc wrote:
>
Quote:
"jt" <karthiks.840@gmail.comwrote in message
news:223752f0-a7a1-48fd-9334-607a80bc61c4@i20g2000prf.googlegroups.com...
Quote:
hello everyone..,
i'm using ubuntu 8.04 OS. I'm not able to output the non-printable
ascii chatacters.
for eg.
printf("%c",1); // nothing is outputted.....
>
is there any way to output these characters...???
They're called non-printable for a reason.
What did you expect to see?
>
when i execute the same statement in windows a smiley will be
outputted.
Then I suppose this code only works on Windows. (And actually,
I don't even suppose /that/ for all Windows.) Your problem is
that different systems use different character sets, and your
code is critically dependent on a specific charset.
So, as a learning experience, it has been very valuable.
But in future, to write portable C code that will compile on
all different systems (at least, with minimal porting effort)
it is best to be charset-agnostic. Basically, the only thing
you can assume is that the characters '0', '1', ..., '9' are
contiguous in value. Everything else (IIRC) is allowed to
change from character set to character set.
HTH.
--
Andrew Poelstra <apoelstra@wpsoftware.com>
To email me, change .net to .com in the above address.