So behebenC++

Programme in C++. Entwicklerforum
Anonymous
 So beheben

Post by Anonymous »

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

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post