MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / outData

Function outData

Project_Bank_Management_System/Header.h:179–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void outData(accounts oldData[]) {
180 ifstream file;
181 file.open("data.txt");
182 if (!file.is_open()) {
183 cout << "Error\n";
184
185 }
186 else {
187 //cout << "file is opened\n";
188 string str = "";
189 int i = 0, j = 0;
190 string strArr[4];
191 do {
192 getline(file, str, '|');
193 if (j < 4) {
194 strArr[j] = str;
195 j++;
196 }
197 else {
198 oldData[i].name = strArr[0];
199 oldData[i].password = strArr[1];
200 oldData[i].balance = stoi(strArr[2]);
201 oldData[i].borrowed = stoi(strArr[3]);
202 ::increaments++;
203 j = 0;
204 strArr[j] = str;
205 j++;
206 i++;
207 }
208
209
210
211 //cout<<str<<"|";
212 }while (!file.eof());
213 }
214}
215void inputNewData(accounts data) {
216 ofstream file;
217 file.open("data.txt", ofstream::app);

Callers 1

MainMenuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected