Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

ASCII Text

This topic is 6852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just use the number that corresponds to the character in a printf() statement:

printf("this is a \225eta version\n");

would read "this is a Beta version"

The \nnn will give you the ascii character for the value.

Otherwise you can do:

printf("This is a %ceta version\n", 225);

where %c is 225 turned into a char representation.

Share this post


Link to post
Share on other sites
Advertisement
\225 will NOT print the ASCII character #225. Rather, it will print #149, because \ooo is the escape sequence to write octal numbers.

Dunno where you got that \nnn thing. It's not in ANSI C. If it's a part of ANSI C++ then I apologize

So I suggest to spheltem to use \xhh instead, which lets you write a hex byte. For character #225 you would write "\xe1"

Share this post


Link to post
Share on other sites
If i wished to display the ascii characters i would write an algorith of:

for(char c=0;c<256;c++)cout << c;

that would display all 256 ascii characters

------------------
-PoesRaven

Share this post


Link to post
Share on other sites
You're right .. /nnn will do octal -- my mistake. I would have used /xhhh for hex, but didn't want to explain the hex part.. yes, use the /xhhh and give the hexadecimal notation for the number.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
First of all, in case you need to know, I'm using Visual C++ 6.0 and am making a Win32 app with no Direct X. Well, my question is how do you display ASCII text? I can get the 1st 175 ASCII characters by putting it directly into the compiler's editor by holding alt and then putting in the ASCII code but beyond that it doesn't seem to work at all. How do you display ASCII characters beyond 175?

Thanks.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!