what i want to do is a loop to check every single char of my buf.
and if it detecs a "X=" , it add to a second variable til find a ";" and do the same when find a "Y=" til find a ";"
example
socket receive a data -> X=80.001;Y=100.400;
so
first variable "X"will be 80.001
and a
second "Y" will be 100.400
i need help, because i don't know how to do it.
CApp_OnLoop.cpp:7:22: error: ‘string’ does not name a type
CApp_OnLoop.cpp:18:13: error: ‘istringstream’ was not declared in this scope
istringstream ss (buf.substr(pos1, pos2-pos1));
CApp_OnLoop.cpp:18:27: error: expected ‘;’ before ‘ss’
istringstream ss (buf.substr(pos1, pos2-pos1));
CApp.h:82:22: error: ‘string’ does not name a type
double extract(const string & buf, string from, string to);
^
CApp.h:82:31: error: ISO C++ forbids declaration of ‘buf’ with no type [-fpermissive]
double extract(const string & buf, string from, string to);
^
CApp.h:82:36: error: ‘string’ has not been declared
double extract(const string & buf, string from, string to);
^
CApp.h:82:49: error: ‘string’ has not been declared
double extract(const string & buf, string from, string to);
i was missing using namespace, now i compiled.
is working right, with some lag, but is working.
i really don't know if is better updating the player pos everytime from server.