getline_error.PNG

This post has no text-based content.

I haven't looked at C++ in nearly two decades, but from what I can remember, it should be:

cout << "enter name\n" << endl;

The new line character should be \n instead of /n and also be within the quotes. However, both \n and endl jump to the next line, so you might be adding redundancy you don't need.

Also, aren't you meaning to do cin >> s1.age and not just cin >> age?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.