Today I have tried setting up vscode for c++ compiling and after compiling a simple cpp program I saw that the output is wrong and i have no idea why.
Here is my code: https://pastebin.com/iLSVHW7T
#include <iostream>
using namespace std;
int main(){
int x[3],i,n;
cin>>n;
for(i=0;i<=n;i++)
cin>>x[i];
for(i=0;i<=n;i++)
cout<<x[i]<<"";
}
Thanks for your time.