Show me the code you're trying to used and someone may understand what you're doing wrong.
That's a good start, but you'll want to format that as code to make it more legible.
(The shortcut for code is to highlight the text and then click the <> button to the right.)
Just as my initial thoughts based on your project description, what you want to do is store your initial deposit into a float in a manner such as
B >> number;, do your math, then output it as the final amount like
B << number;. Upon looking at your code it seems that you're underutilizing the fstream, or using fstream erroneously when you want to be using ifstream for inB and ofstream for outB.
UPTADE 1: I've been testing your code myself and the first big issue I encountered was that your stringstream ss never got initialized.
The first thing you should do with objects in C/C++ is either call a constructor on them or assign them something. Scratch what I said about stringstream. I'm learning too.
ss << accountNumber << ".dat"; may include an assignment, but the compiler doesn't know that.
Last edited on