+ 1
Почему выскакивает ошибка?
Компилятор ругается на NULL https://code.sololearn.com/cs2iGC9Z3e5n/?ref=app
1 ответ
+ 4
instruction in line 32 is redundant.
beside that it is not safe to directly assign NULL to an int ( int c++ >= 11) ( The standard does not define the behavior of your assignment on such an implementation, so its behavior is undefined ).
also line 34:
newArr[i - 1] = arr[i] // index out of bounds, also UB
change it to :
newArr[i] = arr[i+1];