lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lily/freetype-error.cc: const struct #include ;


From: Graham Percival
Subject: Re: lily/freetype-error.cc: const struct #include ;
Date: Mon, 6 Sep 2010 22:35:29 +0100

On Mon, Sep 6, 2010 at 10:30 PM, Wols Lists <address@hidden> wrote:
>  On 06/09/10 22:19, Graham Percival wrote:
>>
>> inside a function)... but since I didn't recognize the C++ construct,
>> I thought it was worth asking.
>>
> As a C programmer, it took me about 30 seconds (or less) to twig what it
> was doing.

Could you take 120 seconds or so to explain what it's doing?  I'm
supposed to be teaching first-year C programming, and I haven't run
across this before.


>> I mean, why _do_ we have a hanging = sign?  I could understand if it
>>
> Because C doesn't give a monkeys about white space, but the
> pre-processor does. The #include has to be the first thing on the line
> otherwise the pre-processor will screw up, but once the pre-processor
> has done its job, the compiler will happily ignore all the surplus new
> lines.

But why does the #include need to be in the middle of the = and ; ?
The only reason I can think of is if that .h includes raw numbers
(without any const/#define/whatever), which seems a bit odd.  I mean,
I'm used to .h files defining constants with const or #define.

Cheers,
- Graham



reply via email to

[Prev in Thread] Current Thread [Next in Thread]