Hello guys can anyone please help me in a problem relating to file.
The problem is that I want to use fgets
on a c file from another c file and increment a the counter every time to get the number of lines and I also want to put the line number is a seperate array where I enconter the string #define..
This was easy & I implemented it using fscanf & strcmp function but this code is not working if the file contains only newlines or spaces in the line but no characters, line numbers are not counted properly because of fscanf property.
That means I have to do a fuzzy substring search in the main line that I have saved in a string which should work for
#define
#define
# define
# define
mind that I cannot use fscanf because then it will not give line numbers properly for all those lines where I have no characters only space or simple a n, those lines are not scanned by fscanf