I've tried a solution for function won but I always get segmentation fault (core dump). First for loop is row

It doesn't work... always this segmentation fault.... what am I doing wrong? please help!

  • We need more information to help you. Pset 3 requires 2 exercises, one for find and one for the game of fifteen. Which one are you having trouble with? Which function or algorithm specifically? If you don't feel comfortable using GDB you can narrow down the problem by use printf, or comment out the lines of code you wrote until the program starts working again. – Luke Van In Jul 16 '14 at 11:04
  • You may update your question with some pseudocode! – Kareem Jul 16 '14 at 11:50
  • First for loop is row<d, second (inner) one is column<d-1, since I don't want to check the last (blank) position; if all the tiles are in the right position, blank space should be as well. I also have a count = 1; In the if statement I check if the actual array[row][column] is not equal to the count, if this true, I return false. It doesn't work... always this segmentation fault.... – Bogdan Arpad Jul 17 '14 at 6:27

gdb is a very important tool that helps you debug your programs. You may use gdb to find errors in your code so that you know how to fix them. If you haven't watched the short on gdb already, you may watch it from here!

| improve this answer | |

You must log in to answer this question.

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