Shy to ask but I cannot figure out why I get only the first character from guests->name in output ? How to print the whole string ?
#include <iostream>
using namespace std;
struct name_table {
char name[20];
};
int main(){
name_table *guests = new name_table;
cout << "Please enter the the line:";
cin.get(guests->name, 20);
cout << "Okay, the line saved: " << *(guests)->name << endl;;
cin.get();
return 0;
}
Thank you