transpose of a 2D array seg faults on non-square arrays

This is a discussion on transpose of a 2D array seg faults on non-square arrays within the C Programming forums, part of the General Programming Boards category; Hi i'm having trouble with a function that simply computes the transpose of a 2D array. It works fine for ...

transpose of a 2D array seg faults on non-square arrays

Hi i'm having trouble with a function that simply computes the transpose of a 2D array. It works fine for square arrays, but then seg faults on non-square arrays. Any Suggestions on what might be wrong?