I've looked in both Ivor Horton's "Beginning Visual C++ 6" book and Lippman's "C++ Primer" (both great books) and haven't been able to figure out how to convert a value stored in a DWORD to a string (I believe this is the best format?) so that I can display it via either a cout command or display it within an MFC text box.
For example, let's say I have the following code:
------start of example code-------------
int main ()
{
DWORD dwTest; //declare 32bit unsigned integer
dwTest=2487924635; //initialize value of dwTest
//cout<<"Here is the stored DWORD:"<<?????<<endl;
return 0;
}
-------end of example code-----
I guess I could take each number, starting with the least significant digit, covert it to an ascii character and output it....but I'd prefer to reuse some existing code.
What is the best way?
thanks, /jerry
For example, let's say I have the following code:
------start of example code-------------
int main ()
{
DWORD dwTest; //declare 32bit unsigned integer
dwTest=2487924635; //initialize value of dwTest
//cout<<"Here is the stored DWORD:"<<?????<<endl;
return 0;
}
-------end of example code-----
I guess I could take each number, starting with the least significant digit, covert it to an ascii character and output it....but I'd prefer to reuse some existing code.
What is the best way?
thanks, /jerry