Regarding ASCII value to character
-
Hello all, I want to get character value from an ASCII value. That is, if i pass 65 then I should get 'A' in return. So how could i easily accomplish this?? Please help me out.. Thanks & Regards, Hemang
char c = 65;
:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
Hello all, I want to get character value from an ASCII value. That is, if i pass 65 then I should get 'A' in return. So how could i easily accomplish this?? Please help me out.. Thanks & Regards, Hemang
char c = 65;
It's as easy as that. Now your c character holds the 'A' letter.Cédric Moonen Software developer
Charting control [v1.4] -
Hello all, I want to get character value from an ASCII value. That is, if i pass 65 then I should get 'A' in return. So how could i easily accomplish this?? Please help me out.. Thanks & Regards, Hemang
printf("%c",i); // i could have any integer value Put in other words you can simply typecast an int to a char to get its ASCII value
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Hello all, I want to get character value from an ASCII value. That is, if i pass 65 then I should get 'A' in return. So how could i easily accomplish this?? Please help me out.. Thanks & Regards, Hemang
-
char c = 65;
:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain ClarkeThat's crazy... You gave the same answer than me and you got downvoted while I got a 5 :doh:
Cédric Moonen Software developer
Charting control [v1.4] -
Hello all, I want to get character value from an ASCII value. That is, if i pass 65 then I should get 'A' in return. So how could i easily accomplish this?? Please help me out.. Thanks & Regards, Hemang
If you want a function anyway:
char getCharEquivalent(int i)
{
char c = i;
return c;
}void main()
{
int i = 65;char cCharEquiv = getCharEquivalent(i);
}
Put a break point inside main and check cCharEquiv, it will be 'A' ASCII is nothing but numeric value of the character.
-- "Programming is an art that fights back!"
-
Hello all, I want to get character value from an ASCII value. That is, if i pass 65 then I should get 'A' in return. So how could i easily accomplish this?? Please help me out.. Thanks & Regards, Hemang
char c= (char)65;
-@SuDhIrKuMaR@-
-
That's crazy... You gave the same answer than me and you got downvoted while I got a 5 :doh:
Cédric Moonen Software developer
Charting control [v1.4]However, don't worry, I don't mind about down voters (and after all, I have a lot of friends). :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
If you want a function anyway:
char getCharEquivalent(int i)
{
char c = i;
return c;
}void main()
{
int i = 65;char cCharEquiv = getCharEquivalent(i);
}
Put a break point inside main and check cCharEquiv, it will be 'A' ASCII is nothing but numeric value of the character.
-- "Programming is an art that fights back!"
-
char c= (char)65;
-@SuDhIrKuMaR@-
Why char c= (char)65; when we can use of char c = 65; ?