iobinary

Read File

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 0.90
sub units 0.90
add a commercial licence to your cart
0
viewed 11176 times and licensed 103 times
www.codecogs.com/d-ox/io/binary/read_file.php
Other modules that are used by this module. We add these to the cart for you whenever you add this module, unless you already own enough licences for them. Click for details
Controller: CodeCogs    Contact Controller

Interface

#include <codecogs/io/binary/read_file.h>

using namespace IO::Binary;

char* readFile (FILE* stream)
Reads the contents of a file into a dynamically created character string.

Function Documentation

 
char*readFileFILE*stream )
This function reads the contents of a file into a new, dynamically created, character string of the same length as the file. in the event of an error, this function return a NULL pointer, signalling that no character array was created.

Example:
#include <stdio.h>
#include <codecogs/io/binary/read_file.h>
 
using namespace IO::Binary;
 
int main ()
{
  FILE* stream = fopen("/Volumes/Data/Components/codecogs/io/binary/read_file.h","rb");
  char* data = readFile(stream);
  printf("\n %s", data);
  fclose(stream);
 
  return 0;
}
Parameters:
stream
Returns:
A dynamically allocated string array, containing the file contents
Authors:
Will Bateman (March 2005)
Source Code:
Register

- To get code register with CodeCogs. Already a Member, then Login.


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2008-05-09 09:49:58

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional