0
I have a script that receives data via socket done in C, and I’m having difficulty working with this data.
Data received from customer: "Imei:123123,23123,tracker,0.0......".
I need to receive this data and give a type of explode to each "," same model used by PHP.
The excerpt from the code I’m struggling with...
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??
Did you mean Strtok?
– Mário Feroldi