+ 2

Where is the error in this code?

Help The output says "Violation of the segment (generated kernel)" https://code.sololearn.com/cLS4yCnVgh1Y/?ref=app

23rd Aug 2018, 11:14 PM
Diego Gongora
Diego Gongora - avatar
2 Answers
+ 1
In CodeBlock, it gives multiple errors, the first: line:45 error: invalid conversion from 'void*' to 'int***' [-fpermissive]|
23rd Aug 2018, 11:57 PM
77rtoip
+ 1
data is of type int*** and you allocate it with int**, which is not an error as both types have the same size. the problem lies when you allocate *data with int instead of int** when I say with a type, I mean : (type)(malloc(sizeof(type pointed by))
24th Aug 2018, 5:40 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar