Solved

Function available on char type...

Posted on 1998-11-09
4
151 Views
Last Modified: 2010-04-02
I need a function to use on char type...

I need one to get the ascii code from a char...
(pex: ord('A')=65 or something like that)

0
Comment
Question by:azerty061597
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
psdavis earned 50 total points
ID: 1177413
How about?

int iAscii = (int) 'A';

or

int iAscii = __toascii( 'A' );

Phillip

0
 
LVL 1

Expert Comment

by:Booth882
ID: 1177414
int CharToInt(char TheChar)
{
    int TheInt = TheChar;
    return TheChar;
}
0
 
LVL 1

Expert Comment

by:Booth882
ID: 1177415
whoops!  I mean

return TheInt;
0
 
LVL 84

Expert Comment

by:ozo
ID: 1177416
Not that it matters....
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now