Liste des Groupes | Revenir à cl c |
Bart <bc@freeuk.com> writes:On 29/11/2024 20:35, Keith Thompson wrote:
Apparently the quibble is about the meaning of 'totally different'. I would have thought that 'incompatible' would have covered it.(So it would have a different type from E declared on in the sameYes, of course D and E have different types. I'm certain he's
declaration:
>
int D[3][4][5], E;
>
? In that case tell that to David Brown!)
aware of that.
What "range of types" do you think D can have?If DB is talking about the type of D[i][j][k], then it is also necessary to consider the types of D, D[i] etc. That's why it's not useful to talk about anything other than the type of the value stored in D (and in C, before D is used in any expression).
Actually types would be another category, that can also start off looking like a variable declaration.In C, declarations can declare objects, functions, types, etc.Would you write "const int F();"? Or would you omit the "const"? How>
does the fact that "const" is allowed inconvenience you?
It's another point of confusion. In my language I don't treat function
declarations like variable declarations. A function is not a
variable. There is no data storage associated with it.
to see how your language is relevant.Because it's confusing in C. The perspective of a quite different syntax /for the same class of language/ makes that extra clear to me.
Yes it is, I'm not pretending at all.In C it is unfortunate, as it makes it hard to trivially distinguish aIt's not as hard as you insist on pretending it is. A function
function declaration (or the start of a function definition) from a
variable declaration.
declaration includes a pair of parentheses, either empty or
containing a list of parameters or parameter types.
Function declarations outside header files are valid, but tend to beFunction declarations are everywhere. They are usually needed for static function otherwise you will have hundreds of function definitions that must be written and maintained in a specific order.
rare in well-written C code.
Les messages affichés proviennent d'usenet.