A few things, by no means a complete analysis of all your code.
1. When you edited your question, you deleted the description of what the code is supposed to do.
2. The default constructor should initialize all fields to default values.
3.
char name[50]
is the C approach. In C++, use
std::string
[
^]. The default constructor doesn't have to initialize
std::string name
, because
string
has a default constructor of its own that will initialize itself to an empty string.
4. A copy constructor should take a
const
argument:
student(const student& that)
.
5. There should probably be a constructor that sets all fields, not just the three marks.
6. The
display
function is either incomplete or was only partly copy-pasted. After submitting a question, proof read it carefully and fix any errors.