0
How can i fix this l?
2 Antworten
+ 1
rand() returns a random number that is higher than the number of elements in class_averageChecker(). Lead to error.
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.