[C] fwrite question

From: Elliot Marks (elliotmarks_at_email.net)
Date: 09/21/04


Date: Tue, 21 Sep 2004 17:51:38 GMT

I want to write binary data to a file. The prototype for fwrite
specifies four arguments, the first being a pointer to an array
containing the data to be written. Must the data generated by my program
first be loaded into an array before fwrite can handle it?

In other words, suppose I have a loop containing code that generates 1
million numbers. Must the numbers first be loaded into an array, or can
they be written directly to a binary file by fwrite without this step?



Relevant Pages

  • Re: C# - Interop causing AccessViolationException
    ... that is passed by reference and populated with binary data in the C ... a pointer to an existing byte array is passed to the ... char rgb_greybar); ... // Get pointer to frame - using SharperCV wrapped for OpenCV ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Finding the size of binary data stored in memory
    ... need to find the size of the binary data being passed to me. ... a separate application ... Is the pointer coming from a separate application, or from, ... There's no general way to get the size of the array given ...
    (comp.lang.c)
  • Re: [C] fwrite question
    ... Thomas Matthews wrote: ... The prototype for fwrite ... the first being a pointer to an array ... >> program first be loaded into an array before fwrite can handle it? ...
    (alt.comp.lang.learn.c-cpp)
  • Re: printf
    ... I have a pointer that points to binary data, and I want to print that ... If I try to cast to then I only get the address of the pointer ... Binary data, 1's and 0's ... If you know the length of the array, you may want to print each element ...
    (comp.lang.c)
  • Re: printf
    ... I have a pointer that points to binary data, and I want to print that ... If I try to cast to then I only get the address of the pointer ... Binary data, 1's and 0's ... If you know the length of the array, you may want to print each element ...
    (comp.lang.c)