I am trying to figure out data structures right now, so I decided to create a testrun program to try struct out. The problem is, I want this program to loop over and over again. But if I enter "n" for no, there is a slight error. The "enter name" and "enter class" are on the same line, with no way to change the value of "name."
Also, what does getline and stringstream do exactly, and what are the benefits of using it? Should I use it here, or is there a better way to input data?
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
struct guildmember {
string Name;
string Class;
int atk;
int def;
};
guildmember NewChar;