You should not attempt to call constructors or destructors explicitly.
Assign a new value to the object in the array, like you would with int
s or anything else:
st[i] = Student(Name_i, id_i);
And remove
st[i].~Student();
0
solved How can we assign variable values to a overload constructor separately(not at Initialization) in Cpp?