by Anonymous » 19 Aug 2025, 01:03
Hier ist die Nachricht: < /p>
Code: Select all
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::erase: __pos (which is 18446744073709551615) > this->size() (which is 22)
Aborted (core dumped)
< /code>
Und unten ist mein Code bisher (soll die Namen und Daten und Beträge in einer durcheinandergebrachten Datendatei neu formatieren, damit es aussieht: < /p>
Foster, Jerry Lee 1995 329,475
< /code>
//This program reformats the retirement account data file oldretirement.txt and outputs the data into a new file newretirement.txt
#include
#include
#include
#include
#include
#include
#include
using namespace std;
void getridof(string &line);
int splitamount(string &line);
int splityear(string &line);
string splitfullname(string &line);
int main(){
ifstream fin;
ofstream fout;
string line;
string finalname;
size_t found;
int finalamount;
int finalyear;
fin.open("oldretirement.txt");
if(fin.fail())
{cout
Hier ist die Nachricht: < /p>
[code]terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::erase: __pos (which is 18446744073709551615) > this->size() (which is 22)
Aborted (core dumped)
< /code>
Und unten ist mein Code bisher (soll die Namen und Daten und Beträge in einer durcheinandergebrachten Datendatei neu formatieren, damit es aussieht: < /p>
Foster, Jerry Lee 1995 329,475
< /code>
//This program reformats the retirement account data file oldretirement.txt and outputs the data into a new file newretirement.txt
#include
#include
#include
#include
#include
#include
#include
using namespace std;
void getridof(string &line);
int splitamount(string &line);
int splityear(string &line);
string splitfullname(string &line);
int main(){
ifstream fin;
ofstream fout;
string line;
string finalname;
size_t found;
int finalamount;
int finalyear;
fin.open("oldretirement.txt");
if(fin.fail())
{cout