Solved

Function available on char type...

Posted on 1998-11-09
4
153 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

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

Suggested Solutions

Title # Comments Views Activity
Create string splitting user defined function in C++ 23 314
C++ assignment question 7 236
Would like to move button in a function 3 79
computer science syllabus 3 88
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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…
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.

789 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