I wonder, if I can reuse the pointer to a variable inside a loop block.
int *ptr = nullptr;
for (int i = 0; i < 5; ++i) {
int j = 5;
if (!ptr) ptr = &j;
cout << *ptr << endl;
}
I believe that this code will work on all compilers, but does it conform to standards?