0
fseek(exsist, start, end);
    while(count < end)
    {
        if(feof(exsist)) break;
        c = fgetc(exsist);
        printf("%c",c);
        if(feof(exsist)) break;
        ++count;

In theory I feel like this should print character by character until either eof or the intended end. Yet I am getting nothing printed to the terminal. I have been opening the file because I have a check above if it doesn’t see it.

5
  • 3
    Please provide us with an minimal reproducible example. What is start? What is end? What is count? Commented Sep 26, 2022 at 12:17
  • We can only guess that end is the same as SEEK_END etc. Commented Sep 26, 2022 at 12:18
  • 1
    Add fflush(stdout) right after the printf() as you don't put '\n', the output buffer is not fllushed. Commented Sep 26, 2022 at 12:37
  • What happens if you get a read error? Commented Sep 26, 2022 at 13:01
  • Exsist is a open file. Start is an int from user of the character to start at. End is an int from the user to stop at. Count is a ticker incriminating after each loop. @RefugnicEternium besides this code there is a check for file fopen ==NULL. William there wasn’t a read error in this code. Thank y’all for the help. I will try the fflush rachid k Commented Sep 26, 2022 at 15:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.