Thank you. Something I still can't understand and if you clear it for me I'd appreciate. Why is fgets returning -1?(even after deleting the code you mentioned). I understand that fgets would be NULL...
Type: Posts; User: aidan4
Thank you. Something I still can't understand and if you clear it for me I'd appreciate. Why is fgets returning -1?(even after deleting the code you mentioned). I understand that fgets would be NULL...
It is comparing the two strings to see if they are equal, if not it returns -1
How could I read the file if it is separated by tabs?
It is separated by tabs.
Thank you again for your response. I tried to implement your code to see how it works and try to implement mine based on that. However, using yours the read_coords returns -1 from this
...
the function actually doesn't return anything. What would cause fscanf not to match any numbers? The file is being opened successfully. I checked that part
Thank you for your response and helping me. I have tried the function and declared the num_max to be 15 as the file has 15 coordinates. I also added a printf at the end of the function to be able to...
Is max_num param represent the number of coordinates that the file has?
Hi everyone,
I am a bit new with C and I am trying to read a file which is (x,y) coordinates and store them individually into an array for further calculations on x or y.
case 1:
...