Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. About FFLUSH in C++

About FFLUSH in C++

Scheduled Pinned Locked Moved IT & Infrastructure
questionc++help
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    john_tran
    wrote on last edited by
    #1

    when i get a string by using gets(ch) (ch is char *), i just get the wasted value at the stdin, not exactly the value i want. How is it? How can i solve this problem? PS : The same problem happened when i use both cin and scanf in same project. Ask More - Learn More JohnJone

    Y D 3 Replies Last reply
    0
    • J john_tran

      when i get a string by using gets(ch) (ch is char *), i just get the wasted value at the stdin, not exactly the value i want. How is it? How can i solve this problem? PS : The same problem happened when i use both cin and scanf in same project. Ask More - Learn More JohnJone

      Y Offline
      Y Offline
      Yulianto
      wrote on last edited by
      #2

      You`ve say it before. Use fflush(stdin):confused:


      Work hard and a bit of luck is the key to success.

      You don`t need to be genius, to be rich.

      1 Reply Last reply
      0
      • J john_tran

        when i get a string by using gets(ch) (ch is char *), i just get the wasted value at the stdin, not exactly the value i want. How is it? How can i solve this problem? PS : The same problem happened when i use both cin and scanf in same project. Ask More - Learn More JohnJone

        Y Offline
        Y Offline
        Yulianto
        wrote on last edited by
        #3

        You`ve say it before. Use fflush(stdin):confused:


        Work hard and a bit of luck is the key to success.

        You don`t need to be genius, to be rich.

        1 Reply Last reply
        0
        • J john_tran

          when i get a string by using gets(ch) (ch is char *), i just get the wasted value at the stdin, not exactly the value i want. How is it? How can i solve this problem? PS : The same problem happened when i use both cin and scanf in same project. Ask More - Learn More JohnJone

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          john_tran wrote: ...i just get the wasted value at the stdin... What exactly is a "wasted value?"


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups