| | |
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 array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node output parameter pointer problem program programming project proxy python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





