Forget the before mentioned stuff, need help on easier topic
I think I have found a solution, below is a copy of the code I am using if anyone is interested. Now I am stuck with one very huge problem.
[B]Does anyone know where I can find a C compiler?[\B]
I know it is not one of the harder problems, but as some may have guessed, I am fairly new to the world of C, and what I do know was picked up in three days of frantic programming about a month ago. Amazingly it worked but back then I had a C compiler available, I do not have one now.
My OS is Linux Kernel or WinXP, I would prefer to compile on my WindowXP machine, due to memory issues, my linux machine only has 150MB of memory left on it from a 256MB harddrive. I know it's small. Unfortunately I am not sure if it matters what OS you compile on in C, I know in other languages it doesn't matter but I thought I'd check first.
Thanks for all your assistance, it is greatly appreciated!!
int sockfd, newsockfd, clilen, n;
int portno = 8010;
struct sockaddr_in serv_addr,cli_addr;
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if(sockfd < 0)
error("ERROR opening socket");
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(portno);
serv_addr.sin_addr.s_addr = INADDR_ANY;
if(bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)
error("ERROR on binding");
clilen = sizeof(cli_addr);
newsockfd = accept(sockfd, (struct sockaddr *) &cli_addr, &clilen);
if(newsockfd < 0)
error("ERROR on accept");
n = read(newscokfd, buffer, 255);
if(n < 0)
error("ERROR reading from socket");
n = write(newsockfd,"Success",7);
if(n < 0)
error("ERROR writing to socket");