| | #1 |
| Warrior Member Join Date: 2014
Posts: 10
Thanks: 6
Thanked 28 Times in 23 Posts
|
I am using Visual Studio using c++. I have a char which holds a value. I need to add the value to a text box, so I have: char x; textBox2->Text = x.ToString(); Trouble is I need to get the ASCII value instead of the decimal. i.e. if x has 117 in it I want to get 'u' in the string, at the moment I get 117. Any easy way to do this! Really appreciate any help! |
| |
| | #2 |
| Never fear the unknown War Room Member Join Date: 2009 Location: Vancouver, BC
Posts: 225
Thanks: 39
Thanked 33 Times in 30 Posts
|
C++ doesn't have a universal toString() method like Java. Though since you're trying to convert a character array to a string, why not simply use the built in string primitive? #include <string> std::string x = "117"; I'm not really sure what you mean when you say you want to get 'u' in the string... some clarification would help. |
| |
| | #3 |
| VIP Warrior War Room Member Join Date: 2006 Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
|
Cast it as a char.
|
| |
|
| Bookmarks |
| Tags |
| appreciated, visual |
| |