A simple question about variable
-
- What does the following sentence mean? - Variable is a constant the compiler knows the value at compile time. - Can you show me an example? - Regards, Maer
couldn't it be the other way round: constant is a variable the compiler knows the value at compile time.. makes much more sense for me... bernhard
""Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
-
- What does the following sentence mean? - Variable is a constant the compiler knows the value at compile time. - Can you show me an example? - Regards, Maer
Variable is a constant the compiler knows the value at compile time Are you talking about const variables? Nish Sonork ID 100.9786 voidmain
-
- What does the following sentence mean? - Variable is a constant the compiler knows the value at compile time. - Can you show me an example? - Regards, Maer
- Where did this sentence come from? - It probably means that since the variable is declared "const", the compiler will know its exact value while it's compiling the file(s) that use it. Thus it can reliably use the variable for such things as allocating memory for arrays. - Example: const int MAX_ITEMS = 20; Item items[MAX_ITEMS]; - Regards, Alvaro
-
Variable is a constant the compiler knows the value at compile time Are you talking about const variables? Nish Sonork ID 100.9786 voidmain
-
couldn't it be the other way round: constant is a variable the compiler knows the value at compile time.. makes much more sense for me... bernhard
""Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
-
- Where did this sentence come from? - It probably means that since the variable is declared "const", the compiler will know its exact value while it's compiling the file(s) that use it. Thus it can reliably use the variable for such things as allocating memory for arrays. - Example: const int MAX_ITEMS = 20; Item items[MAX_ITEMS]; - Regards, Alvaro
-
- Where did this sentence come from? - It probably means that since the variable is declared "const", the compiler will know its exact value while it's compiling the file(s) that use it. Thus it can reliably use the variable for such things as allocating memory for arrays. - Example: const int MAX_ITEMS = 20; Item items[MAX_ITEMS]; - Regards, Alvaro