PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, October 31, 2022

[FIXED] How do I force eof on stdin?

 October 31, 2022     c++, eof, stdin     No comments   

Issue

For a C++ application, how can I programmatically force an end of file (EOF) on stdin?


Solution

Actually, you cannot. As long as you can read data from stdin, EOF hasn't been reached, and in fact you can never reach it. You can close the stdin itself, however. To close it, do this:

fclose(stdin);

After this, you cannot read data from stdin.



Answered By - Nawaz
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing