Hi I'm completely new to C
and used to code in python
so this has been bothering me for a while but I couldn't find an answer that I've been looking for so I decided to ask here.
I am reading a file called "input_date.txt" and will have to split it with delimiter /
and store each part into different int
variable.
Here's what I have so far:
int mm, dd, yy;
FILE* fp = fopen("input_date.txt", "r");
In the input_date.txt
file there is only one line
5/17/07
I'll have to split them and store 5
in mm
, 17
in dd
and 07
in yy
(all int
variables). I kinda figured that I can use strsep
but I'm still not too sure how to work with it (I barely started learning C
) so any help would be appreciated.
fscanf might do what you want?