Solved

Function available on char type...

Posted on 1998-11-09
4
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

724 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