Sujet : Re: do { quit; } else { }
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 12. Apr 2025, 13:39:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vtdmt5$g074$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : Mozilla Thunderbird
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. Oh, wait - it does.
typedef int (*FIntInt)(int);
FIntInt funcs[10];
If a C programmer - such as yourself - is foolish enough to reject parts of the language designed to make coding simpler, safer, clearer and more portable, then I can see how your self-imposed restrictions make your coding harder. But the fault lies in the poor use of the language, not the language.
(Typically you would give the function pointer type a name appropriate to its use rather than based on the parameter and return types - things like "keypress_event".)