I have a script that receives data via socket made in C, and I'm having trouble working with this data.
The data received from the client: "imei: 123123123,23123, tracker, 0.0 ......".
I need to receive this data and give an explode type to every "," same template used by PHP.
The code snippet where I'm having difficulty ...
while(client_size = recv(fd, msgin, sizeof(msgin), 0) != 0){
//log
myfile.open ("x.log",ios::app);
myfile << put_time(localtime(&t), "%c") << " Data: " << msgin << endl;
myfile.close();
//------A intenção seria essa------------
char *text = explode(msgin,',');
.............
..........
memset(msgin, 0, sizeof(msgin)); //Limpa o buffer
}
How to proceed?