LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is a newline? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-a-newline-79049/)

raptorsoft2000 08-04-2003 09:33 PM

What is a newline?
 
I have been using linux now for 2 months, but i just started in C. When compiling with GCC, i get this error:

"warning: no newline at end of file"

this is probably an easy answer, but i would appreciate any help.

thanks

ksgill 08-04-2003 09:37 PM

http://www.linuxquestions.org/questi...002/03/2/16122

raptorsoft2000 08-04-2003 09:40 PM

I looked at that page, and it tells why i need a newline, but i still dont know, "what is a newline?"

what would i have to do just to fix the stupid thing?

thanks!

michaelk 08-04-2003 09:46 PM

Move the cursor down to the right of the last character of the last line of text and press the enter key.

Save file and compile.

ksgill 08-04-2003 09:49 PM

Newline = new line, as simple as that. it means that theres no new line after the last line of your code. Your application expects to find a new line after every line and when it doesnt it issues a warning.

ksgill 08-04-2003 09:56 PM

____________________________________________________
quote:
It means that theres no new line after the last line of your code
____________________________________________________
I meant the text file you are reading from.

michaelk 08-04-2003 10:05 PM

In other words
An End Of Line character in linux is the 0x0A. The end of file marker is CTRL-Z character. NO newline at end of file means there isn't a EOL character between the last character of text and the end of file marker.

Everytime you press the Enter key a 0x0A character is placed in the file. This tells the editor to move the cursor to the beginning of the next line.


All times are GMT -5. The time now is 09:33 AM.