This never stops for some reason
This never breaks
Code:
#include <iostream>
#include <vector>
#include <stdlib.h>
#include <fstream>
using namespace std;
typedef vector<char*> CV;
CV CharacterVector;
ofstream fout;
int main(void) {
fout.open("crap.db");
int Number = 0;
for( ; ; ) {{//stupid smily face arg
CharacterVector.push_back(new char[50]);
cout << "enter a character array "<< endl;
cin.getline(CharacterVector[Number], 50);
if(!atoi(CharacterVector[Number]) == 0) {
cout << "You have chosen to quit" << endl;
break;
}
else {
fout << CharacterVector[Number] << endl;
Number++;
}
}}
fout.close();
return 0;
}
My problem is with the atoi function, it never detects a '0' being entered.
This is kind of sad, I have been programming for a year now and I am still doing stupid stuff like this.
What are your opinions, do you think someone who has been programmign for a year should still be doing stupid stuff like this?