so i finally got the server.c program to run in linux environment i was elated to start the client.c program it turned out that there would be another problem.

below codes are the codes of client program i compiled it and it produced an exe but there is a warning that say's there is no new line at the end of file. what should i do?

WARNING: NO NEW LINE AT THE END OF FILE

another question is.. how will it affect my client.exe? i don't really know what to expect once you run the programs. please explain?

// this part of the code is in the last part this is where the problem lies..

	while(0<(status=read(clientSocket,buffer,sizeof(buffer)-1)))
		printf("%f: %s", status,buffer);
	if(-1==status)perror("read()");
	close(clientSocket);
	return 0;
}

>WARNING: NO NEW LINE AT THE END OF FILE
>What should I do?

Move your cursor to the end of the latest line of your file and press ENTER.
Then try recompiling your source, the warning should be away.

Comments
Free food for the gimme question :)
Your wisdom is endless, all bow to the mighty tux ;)


another question is.. how will it affect my client.exe? i don't really know what to expect once you run the programs. please explain?

It won't affect it at all -- just put the blank line at the end of the file like the warning message asked you to do.

I'm surprised there are still compilers that produce that warning message. I haven't seen it in more than 15 years.

I'm surprised there are still compilers that produce that warning message. I haven't seen it in more than 15 years.

I actually see this warning quit often. I compile a lot of stuff for microcontrollers and all those compilers complain about it.
Most texteditors put a '\n' after each line automatically, so perhaps even 'modern' compilers will complain about it when you give them a file created with something oldschool like 'edit' ?
As far as I know, it's still part of the C++ standard that you can't end a file without a new-line (or a backslash with a new-line) because the behavior will be undefined.

Comments
Good post
That clarifies the whole thing :)

thanks guys..
now another question is how will i test the hello world server/client program.
can i use only 1 pc someone said i should use 2? since its a networking program is that correct?

thanks guys..
now another question is how will i test the hello world server/client program.
can i use only 1 pc someone said i should use 2? since its a networking program is that correct?

You could use what's called: 'a virtual pc'
In that case it's like you have two pc's (but in fact you only have one real pc, and on the real pc you run a kind of emulator software, this is software which emulates the hardware of a pc. In that emulated computer, you can install another operating system, connect it to a network...), but you'll have to make sure that your current pc has enough RAM to run the Virtual Machine on of course.

This article has been dead for over six months. Start a new discussion instead.