C++ Noob Question

LeetViet

Platinum Member
Mar 6, 2003
2,411
0
76
I want to try and write a socket program but after loading int main() the program closes but I guess it's because I didn't write it properly. :s
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Well, unless you put code into your main nothing will happen.

The following code will do NOTHING upon running..

but if you change void main() to:

void main() {
func1();
func2();
}

then it will execute the code in func1 followed by the code in func2
 

LeetViet

Platinum Member
Mar 6, 2003
2,411
0
76
Oh I have stuff in my main(), I just want to figure out how to get it to continuously run (loop?) waiting/accepting connections.

Btw your sig link doesn't work.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: LeetViet
Oh I have stuff in my main(), I just want to figure out how to get it to continuously run (loop?) waiting/accepting connections.

Btw your sig link doesn't work.

Yeah, we are in the middle of changing hosts :)
 

LeetViet

Platinum Member
Mar 6, 2003
2,411
0
76
Originally posted by: BingBongWongFooey
We can't really teach you to program. Get a book or read some tutorials or something.

That's why I said nm, I was just answering MCrusty.

Originally posted by: MCrusty
Originally posted by: LeetViet
Oh I have stuff in my main(), I just want to figure out how to get it to continuously run (loop?) waiting/accepting connections.

Btw your sig link doesn't work.

Yeah, we are in the middle of changing hosts :)

Ah ;)