hi there everyone
i've been a php and vb amateur-programmer for a while, and i've started recently learning C/C++, for my growing interest in game development.
i'm making a simple chat server, that can be accessible via telnet. i tried for about 2 hours, to find an easy way, to get the first n characters in char variable "buffer3" from the char variabile "buffer4". i was only able to do it this way:
Code:
if (SDLNet_TCP_Recv(clnt[j], buffer4, 512)) {
buffer3[0]=buffer4[0];
buffer3[1]=buffer4[1];
buffer3[2]=buffer4[2];
buffer3[3]=buffer4[3];
buffer3[4]=buffer4[4];
buffer3[5]=buffer4[5];
MessageBox(NULL, buffer3, "Message", MB_ICONWARNING);
}
it's supposed to get data from a sdl socket, and (for the moment) just display it. isn't there an easier way to do this? like somthing buffer3=substr(buffer4,0,5) ?
i'm on a windows box, working under dev-c++.
thanks,
izuael.
edit: um, yeah. this is a very n00bish question. i've googled for some help, but they referenced on a header called string.h, and most of the functions gave an error compiling, that's why i am asking