PDA

View Full Version : Connecting to a Sever with C++


iab
01-13-2007, 02:53 AM
Hi, I was wondering how you would connect through the internet to a sever in c++. I need the most compact method of doing this, though. My poorly made online RPG is supposed to be 35 bits per user. Is it the same as running an internet connection in dos? Never tried this before.
Thanks in advance

oracleguy
01-13-2007, 02:57 AM
Well one way I know about, but haven't used myself is using sockets.

What do you mean it is supposed to be "35 bits per user"? That isn't even enough space to send "hello" much less anything else.

iab
01-13-2007, 04:10 AM
I havent put messaging in yet because my intial test made me relize that the compiler I got 2 hours ago, (new update in my old one made it stop working so I got a free one) doesn't reconize strings under ex.
string bob;
bob = "Hello";

and it doesn't understand
string message;
cin >> message;

so who knows maybe I'll just make some smart ai's.

ralph l mayo
01-13-2007, 04:21 AM
Sounds like you might need to put the standard library on your path. You've got #include <string> and #include <iostream> and using namespace std above those examples somewhere, right?