[Dev-C++] initializing string with memory buffer
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Lloyd <ll...@cd...> - 2008-09-15 13:54:20
|
Hi, I am using C++ STL string. I have an IP address something like 1.2.3.4 So its memory will be 0x01020304. I want to initialise a string with this memory. How can I do this? int ip=0x01020304; string s(<I dont know how to fill this area>); so that s[0]=0x01; s[1]=0x02; s[2]=0x03; s[3]=0x04; Thanks, Lloyd ______________________________________ Scanned and protected by Email scanner |