this is my code
Code:
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
struct booking_melakajb1
{
string name;
};
booking_melakajb1 reading()
{
booking_melakajb1 book[3];
for(int i=0; i<=2; i++)
{
cout << "Please insert your name : " ;
cin >> book[i].name;
}
cin.ignore();
return book[3];
}
int main()
{
booking_melakajb1 show;
show = reading();
string aku;
string dia = "y";
cout << "Show all booking output. Type Y for yes." << endl;
getline (cin, aku);
if ( aku == dia )
{
cout << show.name ;
}
system("pause");
return 0;
}
its ok when i compile it... when i run this program... then the windows will popup and says that has encaountered a problem and need to close... what shoul i do????