Hello, I am trying to move data from a client to a server, and save it in a file. However, I am getting a "Runtime Error!" when I use the substr() function, here:
char buffer[256];
int sr = recv(acc, buffer, sizeof(buffer), 0);
string buffStr = buffer;
outfile << buffStr.substr(9,buffStr.size()-1) << "\n";
Once the first line in the file is sent, though, the runtime error is caused in the server, and it occurs only when the substr() function is used. I also have tried "buffStr.size()", "buffStr.length()", and "buffStr.length()-1".
Sorry if its another one of my stupid questions; I seem to be real good at finding them.