Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
sir,
please suggest me the code for to convet string into ascii value using asc method
Posted
Comments
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.
Andi
laxmi smiley 4-Mar-13 4:35am    
the string is from textbox
Andreas Gieriet 4-Mar-13 4:37am    
So, solution#1 might help.
Andi
laxmi smiley 4-Mar-13 5:00am    
thank u sir

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.
Cheers
Andi
 
Share this answer
 
asc() does not exist in C as far as I know, you would need to write your own version. Something like:
C++
int asc(char c)
{
    return (int)c;
}
int asc(char* s)
{
    return (int)*s;
}
// etc
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900