int num1 = 10;
int num2 = 11;
num1 ^= num2;
num2 ^= num1;
num1 ^= num2;
num1 = 11 num2 = 10
Type: Posts; User: jabrams
int num1 = 10;
int num2 = 11;
num1 ^= num2;
num2 ^= num1;
num1 ^= num2;
num1 = 11 num2 = 10
The "learn X in Y days" series of books really sucks IMO
You would be better off getting a "real" book, I recommend
"A Book On C" by pohl/kelley -- it's great for beginners/intermediate
He requires a timeout for connect, this cannot be done by setting a socket option. I guess you're thinking of SO_RCVTIMEO and SO_SNDTIMEO -- they don't set any kind of timeouts for connect.
You could also setup a signal handler for SIGALRM using signal(2)
and then use alarm(2) to send an alarm signal at a specified time.
This will cause connect() to return with EINTR...
int mystrlen(const char *s);
int main() {
char str[] = "123456789abcdefghijklmnopqrstuvwxyz";
printf("Length: %d", mystrlen(str));
return 0;
}
Skipping the first line is easy, fgets(3) will stop reading when encountering a newline, thus your first call to fgets can just discard the data/not write it out to your file.
Skipping the last...
Have you looked at getopt() ?
something like:
#include <unistd.h>
int main(int argc, char **argv) {
change to:
int CreateFile(char *HotN, char *Extn) {
char TmpDt[30], *tmpname;
Do you mean something like indent(1) ?
Try man indent