I normally use R, and have a lot of trouble understanding C. I need to read and store a data file, shown below, so that I can perform calculations on the data.
An example for writing:
FILE *fp;
fp=fopen("c:\\test.bin", "wb");
char x[10]="ABCDEFGHIJ";
fwrite(x, sizeof(x[0]), sizeof(x)/sizeof(x[0]), fp);
(write declaration)
size_t fwrite(const void *ptr, size_t size_of_elements, size_t number_of_elements, FILE *a_file);
If you were to read,
size_t fread(void *ptr, size_t size_of_elements, size_t number_of_elements, FILE *a_file);