Solved

Function available on char type...

Posted on 1998-11-09
4
150 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
Comment Utility
How about?

int iAscii = (int) 'A';

or

int iAscii = __toascii( 'A' );

Phillip

0
 
LVL 1

Expert Comment

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

Expert Comment

by:Booth882
Comment Utility
whoops!  I mean

return TheInt;
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Not that it matters....
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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.

743 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

17 Experts available now in Live!

Get 1:1 Help Now