This might help you o_oCode:#include <windows.h> #include <stdio.h> #include <iostream.h> int main() { string StringToRead; char Playername[80], ip[80]; StringToRead = "Playername 127.0.0.1"; strcpy(Playername, strtok((char*)StringToRead.c_str(), " ")); /* strtok basicly splits the string with the by you choses delimiter. */ strcpy(ip, strtok(NULL, "")); /* This makes the variable 'ip' hold the leftover of the last time we strtok'd. */ cout << Playername << endl; cout << ip << endl; return cin.get(); }




Reply With Quote