Looking for a library function!!

Discussion in 'C Programming' started by Hans, Aug 9, 2006.

  1. Hans

    Hans Guest

    Hi all,
    Is anyone aware of any existing library functions that directly read
    only a fixed number of bytes?? I dont wanna use scanf or put getchar()
    in a loop.. any other suggestions???
    Thanks in advance,
    Hans.
     
    Hans, Aug 9, 2006
    #1
    1. Advertising

  2. Hans

    Ian Collins Guest

    Hans wrote:
    > Hi all,
    > Is anyone aware of any existing library functions that directly read
    > only a fixed number of bytes?? I dont wanna use scanf or put getchar()
    > in a loop.. any other suggestions???


    fread()

    --
    Ian Collins.
     
    Ian Collins, Aug 9, 2006
    #2
    1. Advertising

  3. Hans

    Guest

    Hans wrote:
    > Hi all,
    > Is anyone aware of any existing library functions that directly read
    > only a fixed number of bytes?? I dont wanna use scanf or put getchar()
    > in a loop.. any other suggestions???
    > Thanks in advance,
    > Hans.


    open file by bit style, and fread();
     
    , Aug 9, 2006
    #3
  4. Hans

    Flash Gordon Guest

    Hans wrote:
    > Hi all,
    > Is anyone aware of any existing library functions that directly read
    > only a fixed number of bytes?? I dont wanna use scanf or put getchar()
    > in a loop.. any other suggestions???


    I'm sure lots of people are aware of such functions. What you are
    looking for is probably fread. As always, read your text book and check
    the return value when using it.
    --
    Flash Gordon
    Sigless on this computer.
     
    Flash Gordon, Aug 9, 2006
    #4
  5. On Wed, 9 Aug 2006 04:48:45 UTC, "Hans" <> wrote:

    > Hi all,
    > Is anyone aware of any existing library functions that directly read
    > only a fixed number of bytes?? I dont wanna use scanf or put getchar()
    > in a loop.. any other suggestions???
    > Thanks in advance,
    > Hans.
    >

    fread().

    Or use simply getc() or getchar() to read byte after byte.

    --
    Tschau/Bye
    Herbert

    Visit http://www.ecomstation.de the home of german eComStation
    eComStation 1.2 Deutsch ist da!
     
    Herbert Rosenau, Aug 9, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shanmuhanathan T
    Replies:
    1
    Views:
    559
    Oliver Wong
    Oct 4, 2005
  2. Deniz Bahar
    Replies:
    43
    Views:
    963
    Gordon Burditt
    Mar 2, 2005
  3. Angus
    Replies:
    32
    Views:
    815
    Richard
    Apr 15, 2008
  4. Sammy
    Replies:
    1
    Views:
    315
    NET_NET_2003
    Aug 18, 2003
  5. Mark
    Replies:
    9
    Views:
    176
    Patrick Hurley
    Mar 10, 2006
Loading...

Share This Page