1. If you the programmer provide a constructor that thakes parameters, then you the programmer
is responsible for providing a default constructor if one is required.
This applies to you, bcause you made this constructor for
cal(students arr[50]) which is a constructor taking parameter(s), but you tried to create a cal object using the default constructor here
cal ob1;
You need to do one of two things:
a. provide a default constructor
b. Only create a cal object using the constructors you have provided.
2.
1 2 3
|
ob1.cal(arr[50]);
ob1.serch(arr[50],numUsed);
ob1.show(arr[50],numUsed);
|
You need to create a student array in main and pass it to the functions - basically the same way you you have done with the
int numUsed;
Attempting this
ob1.cal(arr[50]);
is also wrong and an illegal use of a constructor.
You need to to go a do some serious revision/study