qt5 - fstream doesn't work in Qt -
i have code working when compile code blocks, want use in qt5, copied it. , doing nothing. can run application, can not read data out of .txt
file. included fstream, string, iostream , qcoreapplication.
fstream data; data.open("datenbank.txt",ios::in); //variables database string dbname,servername,username,password,rolename,charset,parameters; string newforename ="alex"; // reading txt data data>>dbname; data>>servername; data>>username; data>>password; data>>rolename; data>>charset; data>>parameters; cout<<"test"<<endl; data.close(); cout<<dbname<<endl; cout<<servername<<endl; cout<<username<<endl; cout<<password<<endl; cout<<"test2"<<endl;
what doing wrong?
when compile project folder project name , build rules should appear, has "release" , "debug" sub folders. copy txt folder, not in sub folders. folder name should similiar this:
myproject-build-desktop-qt_4_7_4_for_desktop_-_msvc2008__qt_sdk__debug
Comments
Post a Comment