Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Technical Support » Other » i have run into a problem...
Re: i have run into a problem... [message #213133 is a reply to message #213132] Mon, 14 August 2006 03:01 Go to previous messageGo to previous message
light is currently offline  light
Messages: 988
Registered: January 2005
Karma:
Colonel
I'm more a Java person but i'll ask the stupid questions anyway.

1. Does break; break both while loops of just one? (And why do you have 2 whie loops anyway? Why not this:

Quote:


#include "Socket.h"
#include <string>
#include <windows.h>
using namespace std;

DWORD WINAPI parse(LPVOID lpParam)
{

SocketServer in(3002,5);
Socket* s=in.Accept();
std::string r = "";
while (true)
{
r = s->ReceiveLine();
if (r.empty()) {
break;
}
else {
Console_Output(r.c_str());
}
}
}


2. Would it not save resources and allocation to declare your strong outside your second while loop?

3. EDIT: Wait, on reflection using return 0; inside a method that is not main() is probably your issue. Try removing it. Return 0 basically means "All went well, terminate program, but only main() should call it.


http://www.azupload.com/displayImage.php/setid2745.png
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: just a quick question...
Next Topic: vid card
Goto Forum:
  


Current Time: Sun Jul 28 16:22:41 MST 2024

Total time taken to generate the page: 0.00631 seconds