Deutsch   English   Français   Italiano  
<vtdpdb$jpom$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Richard Heathfield <rjh@cpax.org.uk>
Newsgroups: comp.lang.c
Subject: Re: do { quit; } else { }
Date: Sat, 12 Apr 2025 14:21:45 +0100
Organization: Fix this later
Lines: 52
Message-ID: <vtdpdb$jpom$1@dont-email.me>
References: <vspbjh$8dvd$1@dont-email.me> <vt31m5$2513i$1@dont-email.me>
 <vt3d4g$2djqe$1@dont-email.me> <vt3iqh$2ka99$1@dont-email.me>
 <vt5fed$ccri$1@dont-email.me> <vt5js2$g1t7$1@dont-email.me>
 <20250409142303.00004645@yahoo.com> <87ikndqabc.fsf@nosuchdomain.example.com>
 <20250410115501.000037a5@yahoo.com> <vt8ei8$2vn84$1@dont-email.me>
 <20250410080629.532@kylheku.com> <vt94q5$3jjod$1@dont-email.me>
 <vt9628$3hhr8$3@dont-email.me> <vtammh$174ev$1@dont-email.me>
 <vtavn9$1dp7m$3@dont-email.me> <vtb8nv$1plb2$2@dont-email.me>
 <vtba81$1qfbm$1@dont-email.me> <vtbc6o$1te2o$1@dont-email.me>
 <vtbhjv$24api$1@dont-email.me> <vtbn2k$293r1$1@dont-email.me>
 <vtc19j$2kqlj$1@dont-email.me> <87a58mqt2o.fsf@nosuchdomain.example.com>
 <vtc7mp$2q5hr$1@dont-email.me> <vtdmt5$g074$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 12 Apr 2025 15:21:48 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ac6feb90d86ad6a75e03c4aedc594655";
	logging-data="648982"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+m3Ap4O6e39CtX5Nbzr4X/DtufrRuqtpu3wb243ZhTeA=="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zI/mO0sJjugDdUbZ/FTdkdCNbBc=
Content-Language: en-GB
In-Reply-To: <vtdmt5$g074$1@dont-email.me>
Bytes: 3133

On 12/04/2025 13:39, David Brown wrote:
> On 12/04/2025 01:13, bart wrote:
>> On 11/04/2025 22:36, Keith Thompson wrote:
>>> bart <bc@freeuk.com> writes:
>>> [...]
>>>> Rubbish. Everyone finds C declaration syntax a nightmare.
>>>
>>> Rubbish.  I find C declaration syntax annoying, not a 
>>> "nightmare".
>>>
>>
>> Annoying would be having to get letter case or punctuation just 
>> right.
>>
>> But C typepecs can go far beyond it. I can just about do arrays 
>> of pointers, or pointers to arrays. Anything more complicated 
>> is pretty much trial and error.
>>
>> In an example in my post which I then deleted (DB will just 
>> ignore examples), I wanted to create an array of 10 pointers to 
>> functions that take an int and return an int.
> 
> If only C had a way to make that simple and clear.

But... but... but...!!!

>  Oh, wait - it 
> does.

....Finally!

>      typedef int (*FIntInt)(int);
> 
>      FIntInt funcs[10];

Just one tiny point, though. I've never been a fan of hiding 
pointers behind typedefs. I would much prefer:

typedef int FIntInt(int);

FIntInt *funcs[10];


Better to have those *s out in the open, where we can keep an eye 
on them.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within