Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: what does # mean? Date: Sat, 03 Jun 2017 19:15:07 -0700 Organization: None to speak of Lines: 63 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="fefbb141b8c8fe0ab6f9c2d387eb857d"; logging-data="32312"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/aJQBStCYd5Hzo4YuU3CEB" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:orlSCxGCb5Le6/moCGX9W7acOyw= sha1:F0wuTHjY/WlOxy/hZJgkWq+vDqw= Xref: csiph.com comp.lang.c:111448 T writes: > On 06/03/2017 09:05 AM, Keith Thompson wrote: >> T writes: >>> I don't understand C. I am trying to find something >>> in some source code. What does "#" mean as in >> [snip] >> >> You cannot learn C by asking about one feature at a time. Find a >> decent C book or tutorial (and feel free to ask here for advice >> about finding one). > > I am not trying to learn C. I am trying to find > a missing dependency. I can read Perl, Pascal, Modula2. > I am lost when it comes to C. Hopefully, when I > find what I am looking for, I won't have to read C > again for many years. When it comes to C, there are > folks far better at it than me and I will leave it to them. OK. I've seen a number of questions (not necessarily here) where posters *seem* to be trying to learn C, or some other language, by asking about one tiny feature at a time -- analagous to someone trying to learn English by asking what "the" means. It wasn't at all clear from your original question what you were trying to accomplish. It would have helped us to help you if you had given a little more information about your goals in asking your question. Some people run into something called an "X/Y problem", where they need to do X, assume that Y is the right approach, and then ask about Y. You've probably gotten the information you need by now, but I'll summarize. Many scripting languages use the '#' character to introduce an end-of-line commment. C does not. C comments are introduced by /* and terminated by */ (and may span multiple lines, or part of a line), or are introduce by // and run to the end of the line (inherited from BCPL via C++, and introduced to C by the 1999 standard). The # character at the beginning of a line (possibly preceded and/or followed by white space) usually introduces a preprocessor directive. The preprocessor is a separate translation phase, run before syntactic analysis. It performs conditional compilation (#if, #ifdef, #elif, #else, #endif), file inclusion (#include) and macro definition and expansion (#define). (The preprocessor also has # and ## operators, but you probably don't need to worry about those.) The preprocessor is described in definitive detail in section 6.10 of the current ISO C standard; the latest public draft is http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf One more piece of advice. You've gotten some particularly rude responses (mine was not *intended* to be among them). This newsgroup is, unfortunately, infested with several trolls. A lot of us use killfiles to avoid seeing their nonsense. Replying to them, as we've found from long experience, is not useful, and further damages the group's signal-to-noise ratio. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"