beginners question :
i have code that receives string buffer the buffer size is 128
but i like to print to console the string that actually receives , it can be 10 characters long or 5 or 20
i have :
int lens = 128;
rec_result = recv(new_fd,(char*)buf,lens,0);
// now i like to print only the buf string
// this code dos not work because i can't set the char array like this
// what is the alternative ?
int u = rec_result+1;
what is the proper way to do that ?