I always use // instead of /* */ comments just because I find it looks better. Although it is a pain to have to take out twenty //'s when you would have just had to take out the /* */'s. :P
Type: Posts; User: Twiggy
I always use // instead of /* */ comments just because I find it looks better. Although it is a pain to have to take out twenty //'s when you would have just had to take out the /* */'s. :P
This is how I would do it.
Set a max for your array.
#define MAX_SEATS 10
for (i = 0, i < MAX_SEATS, i++)
{
code:
printf("wang\n");
printf("wang\n");
and...
code:
printf("wang\n"
Am I the only one in doing strings that always puts them as caps? I always toupper everything thats inputted by the user. Maybe its bad programming on my end. :P
I've always wondered this. Still learning C myself. What exactly does this do?
const char* GetDigit(char DigitCharacter)
{
return DigitString[DigitCharacter - 48];
}
I always just add a getch(); at the end and tell them to hit any button to end the program. Crude, but it works fine for me. :)
Can you just send text? ie send(sockfd, "yes", sizeof(buf), 0 );
Also how do you send an enter key? just \r ?
This is what I use to send to the socket.
void write_to_socket(char * buf)
{
send(sockfd, buf, strlen(buf),0);
return;
}
Actually. I was just using this because someone I knew already had a library. However since it doesn't work for me. I'm going back and redoing all the functions one at a time. Right now i've gotten...
Right on. I hadn't though of using netstat. I'm getting connected fine I know that. I've got checks for that. I just can't recieve anything other then a whole load of [[[[[[[[[['s I was just thinking...
I've been plugging away with my sockets. I've set up tests, and read nothing. I've come to the conclusion something must be wrong when I start opening the sockets. As I've downloaded other example...
I added a printf to see if I was getting from the socket. It just came across with a bunch of @@@@@ which leds me to believe that i'm not reading from the socket right.
I'm using visual c++. This...
Oh, and my tcp.h just for giggles.
#define DNS_FAILURE -1
#define SOCKET_FAILURE -2
#define CONNECT_FAILURE -3
int init_winsock(void);
What I posted earlier was my tcp.cpp which compiles fine in VC. However this doesn't.
The error i'm getting;
--------------------Configuration: autoroller - Win32 Debug--------------------...
Actually I figured it out. I'm trying to use DJGPP to compile, but someone pointed out to me that DJGPP just makes dos programs. So I'm getting Visual C++ 6, and hoping that will work. I'm assuming I...
I've tried using Dsock. It would work if I could make Turbo C++ work. However what i'm using is DJGPP. Are there any socket libraries for DJGPP out there? I tried to search for some via google, but...
My apologies. I was just giving an example of what I had to give you an idea of what I was trying to do.
I want to take this.
Strength: 15 Intelligence: 12 Wisdom: 16 Dexterity: 16...
Maybe i'm just dense, but I don't quite follow. I thought there was a thing in strings to count over a certain number. Since the chars over to the stat isn't going to change. That would be the...
I've gotten everything all sorted out for my little program. I followed the link to Dsock found here aswell to get Dsock.h for handling my sockets. Now I just need to figure out how to search this...
Give me a demonstration? I learn better by example. Using goto is the only way I know how to return something to where I want it to be. Also what is the big no no associated with using goto?
I'm using goto incase the string entered wasn't what i wanted, so i can return it to the beginning of the function.
I've also got a way of writing this all to the socket. This is going to be a...
I'm currently making a program for a mud. It takes strings entered by the user and saves them in a file. Once that is finished it connects to the mud, and sends the strings out creating the...
www.textpad.com I use textpad and wouldn't use anything else. :)
Kiss your ass? Why don't you bite me. Your about the only idiot in these boards who actually has that kind of attitude. I've found everyone here quite helpful and kind. If your that deranged and have...
I agree with him. It all falls back under the rule, if you don't have anything good to say. Don't say anything at all. I for one don't need to read your sarcasm.