I'm trying to come up with a way to take a buffer of integers such as the numbers '123456' and translate them singly into their character reprenstation form....
for use with network hand shake of a server/client I am creating.
I've tried quite a few ways of looping through each index of a character array to do this, but to no avail....
Code:int CreateHandShake(char *buf) { char data[10]; char a22[1]; char *b22; strcpy(data, "123456"); b22 = data; for(int cnt=0; cnt < 4; cnt++) { strncpy(a22,b22,1); b22 + 1; strcpy(buf,a22); strcpy(a22, ""); } return 0; }
any ideas? anyone?




Reply With Quote