Makes things very much clearer.
I'm writing some code to process images. The images are stored as a 2D array of pixels.
When i run the code, i get segmentation violation. This usually occurs when trying to access values that are out side of the array your using.
The problem is I'm pretty sure that the my values are all withing the array. Is there any other cause of segmentation violations?
The other problem i have, when i compile i get the following warning:
Image_lib.c:43: warning: return from incompatible pointer type
from the code below
The declaration of the above function was provided by instructor.
int (*image_invert(int width, int height, int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y]))
//(body of code)
return (int **)new_image_data;
it should be returning a 2D array or reference to one (not sure which).