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 |
|
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! |
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. |
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.
|
____________________________________________________
quote: It means that theres no new line after the last line of your code ____________________________________________________ I meant the text file you are reading from. |
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. |