Since any variable can be declared multiple times & this underlying code is allocating memory only once, so why the re-declaration error?
Code:int main(){ //code 1 externint i; int i =90; cout << i << endl; return0; }code 2 works fine.Code:extern int i; extern int i; int main(){ //code 2int i =90; cout << i << endl; return0;}