Click here to Skip to main content
12,450,101 members (47,394 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++
please suggest me the code for to convet string into ascii value using asc method
Posted 3-Mar-13 22:29pm
Andreas Gieriet 4-Mar-13 4:32am
This does not give enough infomration.
- Where does your string come from, i.e. is it in a particular encoding? UTF8? Latin-1? etc.
lakshmi smiley 4-Mar-13 4:35am
the string is from textbox
Andreas Gieriet 4-Mar-13 4:37am
So, solution#1 might help.
lakshmi smiley 4-Mar-13 5:00am
thank u sir
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you have the problem of Windows "ASCII" code, you may have a look at Converting chars to ASCII in C#[^].
If you have some UTF8 encoded data, the question does not really make sense, since the UTF8 code can indicate more characters than ASCII code can.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

asc() does not exist in C as far as I know, you would need to write your own version. Something like:
int asc(char c)
    return (int)c;
int asc(char* s)
    return (int)*s;
// etc

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 4 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100