+ 2

C++

I was using JavaScript and in it you can use variable even before declaring it because during compiling it JavaScript shifts all variables to upside. Is this thing also followed in c++.

17th Oct 2020, 11:39 AM
Adnan Ur Rehman
Adnan Ur Rehman - avatar
2 Answers
+ 3
No it's not. You must declare variables first before using them
17th Oct 2020, 11:46 AM
Anthony Maina
Anthony Maina - avatar
+ 1
Thanks for help.
17th Oct 2020, 12:21 PM
Adnan Ur Rehman
Adnan Ur Rehman - avatar