Thread: Help with fread

  1. #1
    Registered User
    Join Date
    Jul 2012

    Help with fread

    mystring_reply = fread(buffer,1,file_size,infile);
    the code above is sending a size_t value to mystring_reply and im looking to get a character array out of it. this is homework from a tutor and I am suppose to ask on forums like this when im confused so here I am! thanks!

    btw im sticking to c code in this lesson, as would be the reason im not using cin/cout. if someone could explain to me how to do this right that would be great!

  2. #2
    Join Date
    Dec 2007
    So if you're "sticking to C code", why did you ask this in the C++ forum?

    The character array is in buffer. fread(3): binary stream input/output - Linux man page

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fread() questions.
    By gp364481 in forum C Programming
    Replies: 2
    Last Post: 02-05-2009, 11:32 PM
  2. fread
    By dyn4sty22 in forum C Programming
    Replies: 10
    Last Post: 03-27-2008, 02:36 PM
  3. a lil' help using fread()
    By wuzzo87 in forum C Programming
    Replies: 8
    Last Post: 10-06-2007, 03:52 AM
  4. fread: Bus error
    By fnoyan in forum Linux Programming
    Replies: 4
    Last Post: 08-20-2004, 10:30 AM
  5. New to fread()
    By elfjuice in forum C++ Programming
    Replies: 10
    Last Post: 06-22-2002, 02:56 PM
Website Security Test