Difference between getc and fgetc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Parul Bagadia
    New Member
    • Mar 2008
    • 188

    Difference between getc and fgetc

    getc gets the charachter from file stream and points to next charachter, fgetc gets the charachter from file stream and i don't know whether it points to next charachter or not; is that a significant change?
    In the help menu of Turbo C, it's given that its a function version of getc macro. what is a function version?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    getc and fgetc are equivalent.

    fgetc is always a function whereas getc may be implemented as as a macro.

    In your case it appears getc has been implemented as a function.

    Comment

    • Parul Bagadia
      New Member
      • Mar 2008
      • 188

      #3
      Originally posted by weaknessforcats
      getc and fgetc are equivalent.
      Do you mean to say that fgetc also points to next charachter in file?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Yes, that is what wfc meant by equivalent.

        Comment

        Working...