Filling out _iobuf?

This is a discussion on Filling out _iobuf? within the C Programming forums, part of the General Programming Boards category; Hi, I need help filling out an _iobuf (FILE) object so that I can read from any allocated buffer with ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    2

    Filling out _iobuf?

    Hi,
    I need help filling out an _iobuf (FILE) object so that I can read from any allocated buffer with the standard fread() and fscanf() functions. Is there a way to do this which works on any platform? A friend of mine had a try at it but it ended up working on some systems and failing on others.

    Tanks in advance

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >filling out an _iobuf (FILE) object
    Through the standard interface. You're not supposed to know or care about the internals of the thing that your FILE pointer points to.

    >Is there a way to do this which works on any platform?
    setbuf is what you are looking for, perhaps?
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    2

    Talking

    Ahhh, thank you! That was exactly what I was looking for. I have been posting on another forum trying to get that kind of answer, but everyone just said "You can't do that".

    I knew it must be possible. Thanks again.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >but everyone just said "You can't do that".
    The list of things you can't do with C is extremely short, and goofing around with the standard library isn't one of them.
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. double hashing not filling 100% of big tables
    By simpatico_qa in forum C Programming
    Replies: 10
    Last Post: 04-13-2009, 02:42 PM
  2. Help required in image filling program.
    By co123ol in forum C Programming
    Replies: 1
    Last Post: 03-04-2008, 01:42 PM
  3. filling an array of structures?
    By voodoo3182 in forum C Programming
    Replies: 9
    Last Post: 08-06-2005, 05:29 PM
  4. Filling an array from the Command line
    By KalTorak18 in forum C Programming
    Replies: 3
    Last Post: 09-26-2002, 12:55 PM
  5. circle filling
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 06-08-2002, 05:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21