Can i use flush method in C programming -visual studio . explain me with a syntax/

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • parvathireddy
    New Member
    • Jan 2014
    • 8

    Can i use flush method in C programming -visual studio . explain me with a syntax/

    Can i use flush method in C programming . my IDE is Visual studio 2010.

    I want to clear the buffer and again i need to re initialise the buffer and to store a new data



    thanks in advance
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Of course. Just call fflush(stdout).

    Comment

    • parvathireddy
      New Member
      • Jan 2014
      • 8

      #3
      but i need it in C ... I think stdout we use for streams

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        That is C; stdout is a C object declared in stdio.h with type FILE* and fflush is used for streams because, basically, flush is an operation that you perform on streams.

        What was it you actually wanted to do?

        Comment

        • parvathireddy
          New Member
          • Jan 2014
          • 8

          #5
          Thanks Banfa fr replying .
          I actually wanted to clear the existing buffer and to initialise the new buffer in that place. but we tried with different methods. But we are getting two problems.
          1. sometimes getting garbage/junk data
          2. Sometimes it is overlapping / appending


          thanks in advance

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #6
            What do you mean by buffer? How is its cleared state represented?

            Comment

            Working...