hi!
im writing some code about a banking system
i have done so far the classes and functions to create account, save date in a text file find account by last name show account info and although i can read from the file the amount of a client i cant replace that amount with the new
one
...to be more clear
void BankAccount::setamount(string lname, float amount)
{
const char NUM=30;
char buffer[NUM];
fstream in("records.txt");
/*this is my a little bit silly try to avoid binary files and make the in pointer go to the proper line of the file..and ofcourse it doesnt write anything in the file*/
while(in)
{getline(buffer,NUM);
if(buffer==lname)
for(i=0;i<8;i++)
getline(buffer,NUM);
in<<amount;
}
}
darkstar80 0 Newbie Poster
Lerner 582 Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.