I'm a bit stuck. It appears that on the mere declaration of a char ** array there is a segmentation fault.
Here's the exact order of my code:
printf("%d\n", size_of_array);
char** array;
printf("hello");
array = (char**)malloc(sizeof(char*)*size_of_array);
This gives a result of:
18 //my calculated size_of_array
Segmentation Fault
As you can see, hello does not output, hence my confusion.
In addition, I've also tried the statement:
array = new char*[size_of_array];
I don't pretend to be the best at C/C++ but this one is definitely baffling me. In addition (if it is worth noting), I am compiling on a linux machine using g++. Thanks for your help.