Explanation needed for const int "error: variably modified ... atfile scope."

K

Keith Thompson

Poster Matt said:
Peter I couldn't have put it clearer myself. In fact I didn't put it clearer.

Thanks for making my point better than I made it. :)

Something else that you might run across is that C's use of the words
"const" to mean read-only and "constant" to mean compile-time evaluable
are not universal.

For example, Ada uses the word "constant" to mean about the same
thing that C's "const" means:

R: constant Integer := Random(42);

It uses the word "static" to mean that something can be evaluated at
compile time (whereas C uses "static" to mean -- well, all sorts of
things).

The point is that, if you're going to be working in more than one
language, you need to keep track of the concepts and be prepared to be
flexible about the terminology. (But I recommend being *inflexible*
about the terminology within a given language.)
 
P

Poster Matt

Keith said:
Something else that you might run across is that C's use of the words
"const" to mean read-only and "constant" to mean compile-time evaluable
are not universal.

For example, Ada uses the word "constant" to mean about the same
thing that C's "const" means:

R: constant Integer := Random(42);

It uses the word "static" to mean that something can be evaluated at
compile time (whereas C uses "static" to mean -- well, all sorts of
things).

The point is that, if you're going to be working in more than one
language, you need to keep track of the concepts and be prepared to be
flexible about the terminology. (But I recommend being *inflexible*
about the terminology within a given language.)

Thanks for the advise Keith. I'll bare it in mind.

Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top