0

i don't understand why I am getting segmentation fault here is the code : http://pastebin.com/KME0ts09

0

Remember that your variable h might be negative, so always use abs(h) when you want the number of lines in the input file.

Also, in *x = *arr, you dereference null pointer x, should be x = arr;, and later it should be arr = x; without dereferencing.

2
  • sAME result see the updated code now Feb 6 '17 at 14:02
  • You assigned RGBTriples where you wanted to assign pointers to them. Added that to the answer.
    – Blauelf
    Feb 6 '17 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .