Re: A little bit of C fun...

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

 



On Wed, Oct 22, 2008 at 00:44, John Carter <john.carter@xxxxxxxxxx> wrote:
>
> Consider for a moment this program excerpt...
>  a(&(b){c})
>
> Is this valid C++?
>
> Is this valid C?
>
> What would you need to do to get this to compile?
>

Use the preprocessor.  Otherwise you can't get braces inside parens.

#define c return 0;
#define b d)
#define a(T) int d; if (T

int main() {
    a(&(b){c})
}

> What does it do?
>

Whatever you want.

> Could it be tweaked into something useful? (apart from using it to
> hurt people's brains with.)
>

No.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux