Need some help with a union inside of a struct (Solved) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Need some help with a union inside of a struct (Solved)

I am using strncpy to put a string inside a union variable within a struct to create a node. On execution, I get a seg error. What am I missing? Line 42 is where it seems to stop... https://www.sololearn.com/compiler-playground/caR1K53CBvZm

22nd Sep 2023, 7:40 PM
William Owens
William Owens - avatar
1 Answer
+ 3
the error says you have an issue on line 48 in the "if" statement... hint: are you setting a value or comparing? looks like the same issue is in the "if" statement on line 45 as well...
22nd Sep 2023, 7:47 PM
Aaron Lee
Aaron Lee - avatar