| | |
char to hexidecimal
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
You could always use something like this....ofcourse you need to adapt it
Chris
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <string> #include <sstream> using namespace std; int main(void){ ostringstream hello; hello << hex << (int)'A'; cout << hello.str(); cin.get(); return 0; }
Chris
Last edited by Freaky_Chris; Nov 6th, 2008 at 1:16 pm.
Knowledge is power -- But experience is everything
•
•
Join Date: Feb 2008
Posts: 98
Reputation:
Solved Threads: 2
what I want is something like this
i need to cast or a function to convert or something that I dont know about to get the text box to display 0x5F or 5F. Thanks.
C++ Syntax (Toggle Plain Text)
char buffer[10]; buffer[0] = 0x5F; TextBox->Text = buffer[0];
i need to cast or a function to convert or something that I dont know about to get the text box to display 0x5F or 5F. Thanks.
Last edited by Nemoticchigga; Nov 6th, 2008 at 1:34 pm.
Can you not adpot what i gave you....or am i gonna have to spoon feed you?
C++ Syntax (Toggle Plain Text)
ostringstream hello; char buffer[10]; buffer[0] = 0x05; string blah; hello << hex << (int)buffer[0]; blah = hello.str(); TextBox->Text = blah;
Knowledge is power -- But experience is everything
![]() |
Similar Threads
- Basic C assistance (C)
- postfix expression evaluation (C++)
- String to integer conversion (C)
- Help on arrays (C)
- Really simple thing... (C)
- help with programming (C++)
Other Threads in the C++ Forum
- Previous Thread: Deleting an index of array using pointers
- Next Thread: Classic C++ VS Visual C++
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream input int integer java lib linux list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





