Question: I'm having a minor problem when using putty c++ code, here are the instructions and my output yet Rich doesn't appear in my final output,
I'm having a minor problem when using putty c++ code, here are the instructions and my output yet "Rich" doesn't appear in my final output, and it should be included, so I need help fixing this problem, code and text file is below. Thanks in advance.


// CODE
#include
using namespace std;
int main() { string line; vector
while(line[i]!=' ')//read string { inf+=line[i]; i++; } while(line[i]==' ') i++; while(line[i]!='\0' && line[i]!=' ')//read index { ind+=line[i]; i++; } index = atoi(ind.c_str());//convert index from string type to int type vec.insert(vec.begin()+index, inf);//add content at the index read } else if(cmd=="Remove")//if command equals to remove then read the index from which the string has to be removed { while(line[i]==' ') i++;
while(line[i]!='\0' && line[i]!=' ')//read index { ind+=line[i]; i++; } index = atoi(ind.c_str());//convert index from string type to int type vec.erase(vec.begin()+index);//remove content from the index read } else if(cmd=="Print")//if command equals to print then print all contents of vector { for (vector // Transaction.txt Add Student 0 Add Kid 0 Add Final 1 Add Grow 1 Add Note 2 Print Add Rich 5 Remove 1 Remove 7 Add Mind 2 Remove 3 Print
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
