Hello guys, i have a problem at storing some infos of different type in a file.I created a struct so that i can deal with the dif types of the variables, but the vector is problematic,although the compiler gives no error.Could you please help me?Here is the part of my code...
I don't think there's enough information to be able to help.
For example, what does the data entered by the user actually look like?
What does the rest of the code look like?
to me it looks like you are trying to use the vector as a struct on the second to last line
Edit: probably would be more helpful with a bit more code and with code tags
It's probably not safe if you are worried that your teacher will find your code here.
You have not actually told us what the problem is. Is the file not created? Maybe you want to output a new line character after Balance to separate Balance and Account.
the user cannot write the information into the file..the program crushes at the point were i give the data...i don't know if the file is created because the problem is before that...at the while statement...it doesn't work...!!!
is there a way to delete the code?
cin >> name should have a newline in the buffer then his calls to while(cin>>Account>>Name>>Balance) should fail because of the newline still in the buffer.
Note: I haven't tested it because his code won't compile in that state as is and I don't have time to quickly tweak it to make it compile.