anonymous
  • anonymous
Can you do a fscanf inside of a for loop? for example: for(i=0;fscanf(input, "%c", &dummy) != EOF;i++)
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
yes
anonymous
  • anonymous
okay thanks! I will test it out in my program
anonymous
  • anonymous
Did it work?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
yeah slightly...its in a larger program of mine so i think the i++ in the for loop is messing things up. I might have to keep it in a while loop instead
anonymous
  • anonymous
I took the i++ out and it works great now. Thanks again
anonymous
  • anonymous
Seems like a while loop would be more appropriate. You're not using a loop variable, so the for loop doesn't buy you anything. These loops are equivalent: for (a; b; c) ; a; while (b) c; Well, mostly equivalent. In some languages a variable declared in the "a" statement in the for loop won't survive past the for statement body. In the while loop it will. The for loop just gathers the a, b, and c statements together into one neat package so they're conceptually easier to process as a unit.
rsmith6559
  • rsmith6559
If you're sure that there's data, a do while construct may be the best choice: do { fscanf(); } while( !feof);

Looking for something else?

Not the answer you are looking for? Search for more explanations.