0
Similar pattern working for resizing integer array, but not working for object array. Please review and help!
4 Answers
+ 1
Is there a reason why you can't use std::vector for this?
And please choose one of the two threads you want to keep, I see you posted this earlier ...
https://www.sololearn.com/Discuss/2577506/?ref=app
(Edit)
Duplicate removed
+ 1
A short review of your code tells me
Line 7:
<name> and <cms> field should be private.
Line 12:
Member function `addStudent` was declared to return `Student` object, but nothing is returned.
Line 44:
You are assigning a `Student` object from a class member function which doesn't return anything.
You keep creating new array everytime a new `Student` object requires storage space. Once your `Student::addStudent` works, maybe you can look into C `realloc` function instead, as that one actually resize an allocated memory block.
0
deleted the other one.
I don't want to use a vector. I need to clear this concept before jumping into the linked list.
0
Nothing working đ