example4_problematic_case.cpp

1
2
3
4
5
6
7
8
9
#include <iostream>

int main() {
    int x = y;  // Error: forward reference to 'y'
    int y = 5;
    
    std::cout << x << std::endl;
    return 0;
}
Back to forward_reference