So I was programming a calculator, this was the beginning of my code:
1 2 3 4 5
int main(){
vector<double> emil;
cout << "-= Emil's Calculator =-\n\nGive me your first number: "; cin >> emil[0];
return(0);
}
It works fine, but as soon as I define the length of my vector, like this:
1 2 3 4 5
int main(){
vector<double> emil(1);
cout << "-= Emil's Calculator =-\n\nGive me your first number: "; cin >> emil[0];
return(0);
}
the program won't run. My virus protection software says that it has discovered a threat and asks if I want to remove it or not. If I ignore, nothing happens, the console screen stays black and nothing gets written. If I tell it to remove the threat it loads for a few seconds, but still nothing gets written. And if I run the program again, the same thing happens all over again. What should I do? How do I tell the software, in this case AVG, to stop protecting me from this obviously harmless program of mine? And why does it fuck up as soon as I define the length of my vector?