7th Apr 2020, 2:09 PM
Icebreaker
Icebreaker - avatar
2 Antworten
+ 1
rand() returns a random number that is higher than the number of elements in class_averageChecker(). Lead to error.
7th Apr 2020, 2:23 PM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Additional to what CarrieForle said, you also attempt to free memory that you didn't allocate yourself in averageChecker(). Statically allocated memory is managed automatically and doesn't belong to you. You only need to delete memory you obtained earlier through a call to an allocator, e.g. new() or malloc(), so you should also cut the delete expressions.
7th Apr 2020, 4:18 PM
Shadow
Shadow - avatar