Ive been trying to read from an input text file using strings but every time I run my code it reads null or does not read from file at all. I am using xcode so Ive been putting the path instead of the file name. I dont know what I am doing wrong can somebody please help?
char jumbled[SIZE] = "", solution[SIZE] = "";
//declare character and file pointer
FILE* inPtr;
//greet the user and disply the instructions
GameInstructions();
//connect to the input file
inPtr = fopen("filename.txt", "r");
do {
printf("\nReady to play a round of Jumbled!\n");
//read 2 words fromthe file
fscanf(inPtr, " %s", &jumbled[0]);
fscanf(inPtr, " %s", &solution[0]);
//print the words to make sure they were read from the file correctly
printf("\n jumbled is %s and the solution is %s\n", &jumbled[0], &solution[0]);