So this is my code so far...
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int run_t = 0;
char q_mos;
class Destroyer_of_Worlds{
public:
string i_nput;
string i_nput2;
}lard;
int main () { //main executable
cout << "Would you like to write to the temporary datapcku database?\nSelect Y/N\n";
cin >> q_mos;
if(q_mos == 'Y'){//phase one
while(run_t==0){
cout << "Running Input Operations.\n";
//recieve input
cout << "Please provide me with a Question so it can be achrived in the Active DB(Directory)\n";
getline(cin, lard.i_nput);
getline(cin, lard.i_nput);
cout << "Recieved " << lard.i_nput << "at console line\n";
//recieve input
cout << "Please tell me the answer...\n";
getline(cin, lard.i_nput2);
cout << "Recieved " << lard.i_nput2 << "at console line\n";
//terminate while loop
run_t=1;
}
} else {
run_t=1;
cout << "Booting into main operations...\n";
}
cout << "At diagnostic Boot menu, prepare for diagnostic on system config orginaztional routines.\n";
ofstream binlib;
binlib.open ("datapcku.bin", ios::app | ios::binary );
binlib << "Writing this to a file.\n";
binlib.close();
while(1){}
return 0;
}
However if you notice around line (34) you can see that I reiterate the getline( cin, lard.i_nput); two times. When testing this code it would skip right over the first instance of getline and prompt me for my 'answer' from the second one. Very quickly I realized I could by pass this by implementing an addition getline function call before the first one necessary for my program to fulfill its intended task. Does anyone have any idea on how to debug this?