Bill Caroselli <firstname.lastname@example.org> wrote:
OK. This one is silly.
In a C program I am writing a __USAGE message.
I want to use the word it’s.
With a single single-quote mark the compiler complains about an
unterminated string. With two single-quote marks, I get no compiler
errors, but the usage message displays with two single-quote marks.
I also tried escaping the quote with a backslash.The compiler didn’t
like that either.
What is the proper way to display a single-quote mark in a usage message?
Also, since I have not defined __USAGE anywhere, why is the compiler
even seeing what’s inside of that #ifdef block?
Shouldn’t the preprocessor be removing those lines?
I would have thought it should, but you’ve already complained about GCC
Here’s a clever hack I saw:
double quote (")
The other thing, which is what I do now, is to keep the usage in “main.use”.
Ugly, IMHO, because keeping it in main.c keeps me honest w.r.t. the command
Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.