Read File
Reads the contents of a file into a dynamically created character string.
Controller: CodeCogs
Contents
Dependents
Interface
C++
ReadFile
char*readFile( | FILE* | stream | ) |
Example:
#include <stdio.h> #include <codecogs/computing/io/binary/read_file.h> using namespace Computing::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; }
Returns
- A dynamically allocated string array, containing the file contents
Authors
- Will Bateman (March 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.