Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #111448

Re: what does # mean?

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
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 <lnwp8slcr8.fsf@kst-u.example.com> (permalink)
References <ogtotj$r7b$1@dont-email.me> <lna85pm4yj.fsf@kst-u.example.com> <ogv7oi$i8n$3@dont-email.me>
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

Show key headers only | View raw


T <T@invalid.invalid> writes:
> On 06/03/2017 09:05 AM, Keith Thompson wrote:
>> T <T@invalid.invalid> 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  <http://www.ghoti.net/~kst>
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"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

what does # mean? T <T@invalid.invalid> - 2017-06-03 00:39 -0700
  Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 10:06 +0200
    Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 01:25 -0700
      Re: what does # mean? Leon Taylor <leontaylor476@gmail.com> - 2017-06-03 03:41 -0700
      Re: what does # mean? Keith Thompson <kst-u@mib.org> - 2017-06-03 09:03 -0700
        Re: what does # mean? bartc <bc@freeuk.com> - 2017-06-03 17:11 +0100
          Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 13:56 -0700
  Re: what does # mean? Jerry Stuckle <jstucklex@attglobal.net> - 2017-06-03 09:24 -0400
    Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 13:52 -0700
    Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 13:55 -0700
      Re: what does # mean? Jerry Stuckle <jstucklex@attglobal.net> - 2017-06-04 18:19 -0400
        Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 01:54 -0700
  Re: what does # mean? Keith Thompson <kst-u@mib.org> - 2017-06-03 09:05 -0700
    Re: what does # mean? gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-03 16:18 +0000
      Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 18:22 +0200
        Re: what does # mean? gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-03 16:30 +0000
          Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 19:18 +0200
            Re: what does # mean? gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-03 18:03 +0000
    Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 13:59 -0700
      Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 23:30 +0200
        Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 14:35 -0700
          Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 23:55 +0200
            Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 15:30 -0700
              Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-04 00:36 +0200
                Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 16:12 -0700
                Re: what does # mean? Ian Collins <ian-news@hotmail.com> - 2017-06-04 11:17 +1200
                Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-04 01:23 +0200
      Re: what does # mean? Keith Thompson <kst-u@mib.org> - 2017-06-03 19:15 -0700
        Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 19:27 -0700
          Re: what does # mean? Manfred <noname@invalid.add> - 2017-06-04 19:09 +0200
            Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 01:56 -0700
          Re: what does # mean? Keith Thompson <kst-u@mib.org> - 2017-06-04 13:51 -0700
            Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 01:57 -0700
  Re: what does # mean? James Kuyper <jameskuyper@verizon.net> - 2017-06-03 23:08 -0400
    Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 20:53 -0700
      Re: what does # mean? John Bode <jfbode1029@gmail.com> - 2017-06-05 12:44 -0700
        Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 14:52 -0700
  Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 03:00 -0700

csiph-web