| | |
char to hexidecimal
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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++
Views: 357 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





