Connecting Tech Pros Worldwide Forums | Help | Site Map

Re: ASCII characters

Andrew Poelstra
Guest
 
Posts: n/a
#1: Sep 5 '08
On Fri, 2008-09-05 at 05:32 -0700, jt wrote:
Quote:
On Sep 5, 5:26 pm, Chris Dollin <chris.dol...@hp.comwrote:
Quote:
jt wrote:
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.....
Well, presumably it's called a non-printable character because it
doesn't have a printing representation.

What do you want to see if it's non-printable? Use `isprint` to
find out if its printable or not, then decide how you want to
display a non-printing character.

#include <ctype.h>

void printCharSomehow( unsigned char ch )
{
printf( (isprint( ch ) ? "'%c'" : "char(%d)"), ch );
}
please check the below link..i want to print those symbols..
http://didgood.com/programing/datath...scii-0-127.gif
Please don't quote signatures. I snipped Chris' for you.

You do what you want, you need to change your printing
charset to ASCII. Whether this is possible is specific
to your implementation, as are details about how to do
so. /Why/ you would ever need to do so is debatable.

--
Andrew Poelstra <apoelstra@wpsoftware.com>
To email me, change .net to .com in the above address.


Richard Bos
Guest
 
Posts: n/a
#2: Sep 5 '08

re: Re: ASCII characters


Andrew Poelstra <apoelstra@wpsoftware.netwrote:
Quote:
Please don't quote signatures. I snipped Chris' for you.
While we're on the meta stuff, your newsreader is removing References:
headers. This is Not Good.

Richard
Keith Thompson
Guest
 
Posts: n/a
#3: Sep 5 '08

re: Re: ASCII characters


Andrew Poelstra <apoelstra@wpsoftware.netwrites:
Quote:
On Fri, 2008-09-05 at 05:32 -0700, jt wrote:
[...]
Quote:
Quote:
>please check the below link..i want to print those symbols..
>http://didgood.com/programing/datath...scii-0-127.gif
>
[...]
Quote:
>
You do what you want, you need to change your printing
charset to ASCII. Whether this is possible is specific
to your implementation, as are details about how to do
so. /Why/ you would ever need to do so is debatable.
No, ASCII doesn't have a smiley at position 001. The cited table does
not accurately reflect the ASCII character set.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Andrew Poelstra
Guest
 
Posts: n/a
#4: Sep 6 '08

re: Re: ASCII characters


On 2008-09-05, Richard Bos <rlb@hoekstra-uitgeverij.nlwrote:
Quote:
Andrew Poelstra <apoelstra@wpsoftware.netwrote:
>
Quote:
>Please don't quote signatures. I snipped Chris' for you.
>
While we're on the meta stuff, your newsreader is removing References:
headers. This is Not Good.
>
Thanks. I'll switch back to slrn (I was using Evolution and having
all sorts of minor problems, but this one takes the cake.)

--
Andrew Poelstra apoelstra@wpsoftware.com
To email me, use the above email addresss with .com set to .net
Closed Thread


Similar C / C++ bytes