Um, I actually did read most of it, though I didn't read everything that well. I also skippet the last parts (part > 5), and mostly used it as a reference to the functions. I don't like people...
Type: Posts; User: kristy
Um, I actually did read most of it, though I didn't read everything that well. I also skippet the last parts (part > 5), and mostly used it as a reference to the functions. I don't like people...
That's generous, thanks. :)
The UNIX man page says something like that, too (I run Mac OS X).
I'm not new to C or programming in general. But there's a few things with C I've never gotten the hang of, and that has just...
I use exit all the time! :D If the predefined macros really are easier to port apps with, I don't know. I just read it, and I wanted to find out what macro that was defined to what value.
Oh well,...
Yeah, that was what I ment, I just didn't explain it well (English is not my native language). :cool: Usually I use either 0 or -1, but I've heard it's better to use the predefined macros, like...
Hm, yeah, maybe telnet is better, though telnet isn't very secure. But on a LAN I guess it's no problem. :)
Btw, this is a bit off-topic really; I tried to find the available values for the exit()...
I just wanted to say thanks for all the help! I just finished writing my first app that actually works, using sockets. :D anonytmouse, after you pointed out what was wrong it started working much...
I should mention that my app fails on connect(). Usig herror() it says "Resolver Error 0 (no error)" and with perror() it says "Operation timed out". Does this indicate a server or client/code...
I guess I was trying to write a client of some kind. Do you never need to use bind when you create a client?
As long as the port is open, I can get a response from the host? How about if you try...
I did read it, and I didn't get it. I don't get why the *-operator is used twice..
I tried to write some code (which I guess clearly shows I don't know what I'm doing!), and it fails on the bind...
The casting in the last code snippet screams confusion to me. :rolleyes: :cool: I get that inet_ntoa() takes a struct of the type in_addr, but why the * both in front of the cast and inside the...
Yeah, I probably should. Network programming tends to psyche me out though. Even the smallest programs are very advanced. I'm not very good with pointers yet, and strucs are, as already mentioned,...
Thanks! :D
I think I've misunderstood the function gethostbyname().. Whatever input I give the function, IP or domain name, it only returns the input. That can't be right, can it? The code is this:
#include...
Isn't the -> and . equivalent? I always thought so at least.. :rolleyes: I tried both in my code, and only the -> worked, as you suggested, anonytmouse. Thanks! :)
I'm trying to some something that should be pretty simple; use the gethostbyname()-function. My problem is that I don't understand what the struct is doing, and why I need it. Structs in general...
Thank you for your reply, Salem. It was a good idea to split up the function, it was definitely getting too large.. I created a function very similar to your which processes the line, and returns a...
hehe, excellent! :D
I love assembly, though I suck at it. :cool: It's certainly a language where you really have to know what you're doing, and how it's interpreted in the computer.
In a function I'm having three loops, that are nested. But something's not working, and it's driving me nuts! Is there a limit for how long a loop can be, or how many loops that can be nested?
My...
I don't agree. It has its faults, yeah, but no book is pefect, and it's less 'intimidating' than Ritchie's book (wich also has code errors), imo at least. I guess the bottom line is to read more than...
I know you wanted online material, dianazheng, but getting a book is also a good idea. :)
Practical C Programming are The C Programming Language are good books. Also Deitel's books are concidered...
Prelude; In my man page is says: "The atoi() function has been deprecated by strtol() and should not be used in new code."
But this may not be a standard, though, and perhaps also only written in...
Isn't atoi() actually deprecated?
This program won't compile for me (due to conio.h), but remember to include a return status for main. Your code is, unfortunately, not very portable, since *NIX systems needs curses.h for getch().