Check out example codes for "read a document in c getting name from console". It will help you in understanding the concepts better.

Code Example 1

#include<stdio.h>
int main(int argc,char *argv[]){
	FILE *in=fopen(*++argv,"r");
	char c;
	while((c=fgetc(in))!=EOF)
		putchar(c);
	fclose(in);
	return 0;
}

Learn ReactJs, React Native from akashmittal.com