I would like to know if there is an equivalent of fseek
and ftell
when I'm working in main.
For example, if I type the name of a file when asked, at end I hit enter. Next I'll ask the user another file name, but there's a '\n'
in the buffer that was not read. The user won't be able to type the name of the second file because the program will read the '\n'
. So I would like to move one position forward in the buffer. Normally in a file I would do:
fseek(file, ftell + 1, SEEK_SET);
I would like to do the same thing when I'm in main, not working with a file.