Friday, February 18, 2011

Breaking up lines\ is easy to do part3

Author: Joe
Partner: dvd ripper

To wit, change Lines 10 and 11 in the source code from this:


printf(“C is done mostly in lowercase.\
It’s a case-sensitive language.”);

to this:
printf(“C is done mostly in lowercase. \
It’s a case-sensitive language.”);


Note the extra space after the period in the first line (before the backslash), which keeps the two lines of text from running into each other. Save that mess. Compile and run. The output shall be most pleasing to the eye.


Do note that some programs elsewhere in this book may use the \ to split long lines.


Don’t worry about using the \ to split any lines. It’s a trick you see others use occasionally, but in my travels I prefer using a sideways-scrolling editor to splitting up long lines.


Although split lines are treated as a single line, any errors that happen on either line are given their proper line number in the source code file. So, if a semicolon were missing at the end of Line 11 in the RULES.C example, the compiler would flag it on that line, not on the line before it.

See also:

http://clanguage86.blogspot.com/2011/01/four-steps-to-build-c-program.html

http://clanguage86.blogspot.com/2011/01/5-steps-to-reedite-your-c-source-code.html

http://clanguage86.blogspot.com/2011/01/what-meaning-of-recompiling-c-program.html

No comments:

Post a Comment