Hi guys I was expecting an out of scope error in my program but it worked fine with no errors I'm just wondering why this happens as I declared the items of myVector inside the main function yet I can still access them in a function outside the main function
if it's not declared inside a function/class/struct... it's a global so can be seen everywhere. Where you set/get values does not change where it's visible from as that is the visibility.