For some reason this code is seg faulting when I try to run it. count=g_width * j; seems to have something to do with it. Please help
Code:#include <stdio.h> #include <stdlib.h> #include "transform.h" void mirror(struct pixel *theArray[]) { struct pixel * temp; int count; int i; int j; for(j=0; j<g_height; j++) { count=g_width * j; for(i=0; i < g_width/2; i++) { temp=theArray[i+count]; theArray[i+count] = theArray[g_width-1-i + count]; theArray[g_width-1-i + count]; } } }