0

enter image description here

As mentioned in the title, on debugging C++ code an Exception occurred(as seen in the picture). How can I overcome it?

It's my code that induces Exception.

#include <iostream>
#include <vector>

int main()
{
    int t;
    std::cin >> t;
    std::vector<int> v(t);

    for(int i = 0; i < t; i++)
    {
        std::cin >> v[i];
    }
    
    for(const auto& e : v)
    {
        std::cout << e << '\n';
    }
    
    return 0;
}
Zoso
  • 3,273
  • 1
  • 16
  • 27

1 Answers1

1

Thank you all guys. I finally solve this problem. It occurred when debug mode has been changed x86 to x64 in VS. but I still dont know why these exceptions occurred when debug mode is x64, I just guess that's maybe occurred when last debugging is proceeded on x86 mode at the same project.