CDECL source code
Martin Weitzel
martin at mwtech.UUCP
Mon Nov 26 22:28:51 AEST 1990
In article <12671 at ganymede.inmos.co.uk> conor at inmos.co.uk (Conor O'Neill) writes:
>In article <5656 at abaa.UUCP> korsberg at abaa.UUCP (Ed Korsberg) writes:
>>I am looking for the source code to a program [ to ]
>>translate an English description of a C variable into the C-style
>>variable. For example [...]
>> int (*(*x)[10])();
>Doesn't anybody else see the irony of needing a program to write
>C declaration syntax?
>
>And some people teach this language to beginners....
I don't quite understand this. What really *is* a problem teaching C to
beginners is that it may be difficult to explain the concept of pointers
to functions (oh well, ever teached those `senior programmers' who were
doing their `professional work' with BASIC for ten years or more an to
whom you can't explain *anything* if you can't show how this can be done
in BASIC).
But if you mean the syntax: I've never ever had difficulties to explain
the C syntax to beginners, provided they had understood the concepts of
pointers, arrays, and functions. Probably there are many teachers out there,
who still have difficulties understanding the syntax. It is more or less
human that many of those teachers try to hide their own problems by using
a program as "cdecl" to prepare their questions and check the answers of
their students.
I've too sometimes given "cdecl" to my students, but not before I was sure
that they used it only to re-check the answers they figured out *without*
using it.
BTW: It would be nice to have a "cdecl" program with a buildtin "quiz-mode".
Such a program should randomly generate questions (either in C syntax
or in verbose description of the desired type) and then accept answers
(for the beginner in multiple choice style). I'm sure, a student playing
half an hour with such a program will never ever need to use "cdecl" for
real programming tasks.
--
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83
More information about the Comp.lang.c
mailing list