Find the answer to your Linux question:
Results 1 to 2 of 2
Hi All, i am new to C language , can any one tell me the differece between the getc and fgetc function. Thanks, Room...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    1

    difference between getc and fgetc function

    Hi All,
    i am new to C language , can any one tell me the differece between the getc and fgetc function.

    Thanks,
    Room

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Hi,

    They both read a character from the given stream but getc is a macro that expands in-line.
    So something like this may goes wrong if the macro expands it:

    Code:
    getc(tabel[i++])
    Check your manual for how a macro expands parameters in-line.

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...