I'm in the early stages of learning C, and I want to develop on OSX. I wrote a simple program that uses fopen() on a .txt file (in the local directory of the source.c file) and uses fscanf() to read the first line into an integer.
It works fine using codeblocks in a windows environment, but it doesn't work on any ide I've tried on OSX. It returns "Segmentation Fault: 11". What am I missing?
int main ()
int num = 0;
fpointer = fopen("test.txt", "r");
fscanf(fpointer, "%d", &num);