0

variable name is used prior to its definition?

The variable name seems used before its definition in this class. Why?

6th Jun 2017, 2:56 AM
Ming Ma
Ming Ma - avatar
3 Answers
+ 3
can you paste the code?
6th Jun 2017, 3:01 AM
Daemo
Daemo - avatar
+ 1
In C++ before the usage of variable we need to declare to make the compiler familiar about the variable. The compiler will compile the code at that time if the variable is not declared before definition then it will throw compiler exception. But in java we can declare variable where ever we want and in C++ it should be at the beginning of program that is after header and macros.
6th Jun 2017, 3:53 AM
Nanda Balakrishnan
+ 1
it is not normal. could you show us the code?
6th Jun 2017, 4:15 AM
Raphaël Charozé
Raphaël Charozé - avatar