Computing.Net > Forums > Disk Operating System > ASCII in Turbo C++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ASCII in Turbo C++

Reply to Message Icon

Name: chad
Date: November 13, 2001 at 19:14:58 Pacific
Comment:

What is the command to use the ASCII chaaracters in Borland Turbo C++? I know that in BASIC it is CHR$() and to change back it is ASC(). How about C++?



Sponsored Link
Ads by Google

Response Number 1
Name: jhk;l'k
Date: November 14, 2001 at 11:24:55 Pacific
Reply:

just use the character's ASCII code; for example to print the character 'a':
putchar(97);
will do the trick.
you can assign numbers to so-called char variables, which the C compiler doesn't mind if you dont assign a charcater constant to because it treats them simply as general-purpose bytes:
unsigned char c = 254;
char ch = 119;
ch += 4;


0

Response Number 2
Name: chad muska
Date: November 14, 2001 at 14:44:02 Pacific
Reply:

Excellent, thank you. What I am hoping to do is to figure out a way to save images in a special way where that each pixel is one character in the ASCII table.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: ASCII in Turbo C++

I want Turbo C for DOS!!! www.computing.net/answers/dos/i-want-turbo-c-for-dos/3845.html

problem in turbo c++ www.computing.net/answers/dos/problem-in-turbo-c/16956.html

Mouse in C++ www.computing.net/answers/dos/mouse-in-c/3258.html