#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main() {
string names[] = {"Jim", "Rob", "Sam", "Tim"};
int i;
i = 0;
string stain;
stain = "f";
while (stain == "f") {
if (names[i] == "") {
stain = "p";
}
i += 1;
}
for (int go = 0; go <= i; go += 1) {
cout << names[go] << endl;
}
int stop;
cin >> stop;
}
I wrote this code to practice arrays and I just want it to loop through and print out the names. It prints out each name on new lines like its supposed to but then Windows says "names.exe has encountered a problem and needs to close. We are sorry for the inconvenience." Then it gives you the option to send an error report or dont send. How do I get that to go away?