Hi there, I am having trivial problem in reading a simple file (see below).
This file is not a list of numbers or list of strings, but is a combination of the two.
All is fine when I read it line by line and assign the numbers to a certain variable by using fscanf, but when I try to do the same for the strings, I obtain a bus error.
I hope someone can help;
thank you in advanced,
My code looks as it follows, and the input file is the next:
Code to read it:
const char *problem; // After reading the file this variable would be something like this:
// problem = "problem_type"
// problem = "problem_name"
file_ID = fopen("input.txt", "r");
//Read the content of the input file:
fscanf(file_ID, "%f\n", &x);
fscanf(file_ID, "%f\n", &y);
fscanf(file_ID, "%f\n", &z);