I got segmentation fault when I start running my project.
I have declared 2 different classes
Class myfirstclass {
int x[4];
};
In the second class
I access the array “x[4]” using the following
myfirstclass * firstptr;
firstptr -> x[4];
Now when I assigned the “firstptr -> x[4];” to an array to do some computations I got a segmentation fault?
int y[4];
for (int i=0; i<4;i++){
y[i]= firstptr -> x[i]; -> "This statement what caused the segmentation fault."
}
Can you help me fixing this error, please?
firstptr?