ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
C/C++ (and Java and C#) have a notion of "escape characters": special
codes like '\t' (tab), '\b' (backspace), '\n' (newline in Unix, CR/LF in DOS), and so forth.
There are a fixed, predefined set of these escapes, and the compiler message
is a complaint telling you "\lb" isn't one of them.
So the question is "What did you *intend* to do?"
If you wanted to print the text "per\lb", then Tinkster's advice is correct:
printf(( " Calculated enthalpy is %d btu per\\lb\n",enth));
<= THE "\\" SYNTAX ESCAPES THE ESCAPE CHARACTER, GIVING YOU A SINGLE "\"
2. End of file:
Many (although not necessarily all) C/C++ compilers demand a "\n" (linefeed, or CR/LF) after
the last line of code. So it's always good practice to put an explicit line or two after the last line in your source file. Tinkster said "before" the brace; I think he meant "after"...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.