hi im trying to make a "settings" that they are on c++
and saving on text documents
here is the code
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
int main(){
fstream first("firstt.txt");;
fstream File("file.txt");
string firsttime;
string blah1 = "enable";
string blah2 = "disable";
getline(first, firsttime);
if(firsttime=="not"){
} else{
cout << "first time settings (to be changed at file.txt)" << endl << "allow every one enter? enter disable(for no) and enable(for yes)" << endl;
string allow;
int end=0;
while(end!=1){
cin >> allow;
if(allow==blah1){
File << "allow?" << endl << "enable";
end = 1;
system("exit");
}else if(allow==blah2){
File << "allow? \n";
File << "disable";
end = 1;
system("exit");
}else{
cout << "sorry what? please enter again" << endl;
}
}
first << "not";
first.close();
}
string canIS;
for(int i =1; i<=2;i++){
getline(File, canIS, '\n');
}
if(canIS=="enable"){
cout<<"hey you hit the second line ";
cout << canIS;
} else {
cout << "sorry the admin do not allow to you";
}
int blah;
cin >> blah;
}
its dosent write anything in the text documents
thx anyway