Showing segmentation fault works fine though

My code is showing segmentation fault in coding blocks ide and hence not getting accepted.But it works fine on codeblocks ide and ideone
MY CODE-

hello @abhinavgoyal912
initialise left and right with NULL in ur tree constructor and then try

Nope still shows the same error

@abhinavgoyal912
yeah i have checked it , it is working in other ide .

try this build tree function->
image

or
use string in place of char array.

ur updated code->

Note -> the issue is related to compiler , logically ur code is totally fine

1 Like