Use of SOH, SPACE, CR and LF in c program
Hi
I have to compile a string and send it to an IP address. the string needs to have this format SOH>SOMETEXT<SPACE>SOMETEXT<CR><LF> i have a char data[100] defined i want to put the above string into the char data[100] i know how to put the text in using strcat, but how do i put in the SOH (0x01), Space (0x20), CR(0D)and LF(0A) around the string? thanks Tara |
Hi,
you can use character escape sequences \xhh where hh is the hexadecimal number. Code:
data[0]='\x01'; Code:
data[i]=' '; graeme. |
Hi Graeme
thank you, works nicely cheers Tara :) |
All times are GMT -5. The time now is 02:11 PM. |