FUNCTION
Read_File
Reads the contents of a file into a dynamically created character string.
Interface
#include <codecogs/computing/io/binary/read_file.h>
using namespace Computing::Io::Binary;
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/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
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.