Sujet : Re: technology discussion → does the world need a "new" C ?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 12. Jul 2024, 12:52:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240712043125.115@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-07-12, Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> wrote:
On 12.07.2024 08:00, David Brown wrote:
[...]
I can understand when someone new to C gets mixed up about how arrays
work.
>
I can't understand that if I presume that the person has read any
basic textbook about "C".
Problem is that over the years there have been authors of basic textbooks about
"C" who were also confused by things like this.
For instance, in Herbert Schildt's "C: The Complete Reference",
3rd Ed, page 53, this can be found:
/* Write 6 integers to a disk file. */
void put_rec(int rec[6], FILE *fp)
{
int len;
len = fwrite(rec, sizeof rec, 1, fp);
if(len != 1) printf("write error");
}
Of course, "sizeof rec" is the size of a pointer, not likely
equal to the size of an array of 6 elements.
The intersection of authors who are skillful presenters of material,
knowledgeable about C, and motivated to write about it has not been that large.
We could add to that, "write about new C, and motivated to keep up with ISO C
developments and crank out new edititons".
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca