Guest_imported
New member
- Jan 1, 1970
- 0
HI
im a newbie
i want a source code that converts the ascii into hex.
Thanx
im a newbie
i want a source code that converts the ascii into hex.
Thanx
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
char buffer[128];
// read in buffer
// now buffer contains some string
int len = strlen(buffer);
char hex[4];
memset(hex,0,4);
for(int i = 0;i<len;i++)
{
sprintf(hex,"%x",buffer[i]);
// hex now contains the string equiv of the hex value
}
//if you just want to output in hex
cout<<hex<<buffer[i]<<endl;
could replace the sprintf