i'm hoping someone can help me with this little piece of code. It's a stupid test, but i dont know what is it that i am doing wrong. It's like this:
#include <stdio.h>
int **ipp;
int ventas [3][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
int main(void){
ipp = (int **)ventas;
printf("%d\n", **ipp);
return 0;
}
It compiles (I'm using GCC), but when I execute it I keep getting a segmentation fault. What am I doing wrong? I think it has something to do with an un-initalized pointer, but 'ventas' is an array so it is already initialized, and it's assigned to **ipp.