I know that you can do this if you have elements in your array:
FILE *ptr;
ptr = fopen( bobby.txt , "wb" );
int array[3] = {1,2,3};
fwrite(array, sizeof(int), 3, ptr );
fclose(ptr);
but, when we come across corner cases like an empty array, how would we copy an empty array into a file? Would it look something like this?
FILE *ptr;
ptr = fopen( bobby.txt , "wb" );
int array[0] = {};
fwrite(array, sizeof(int), 0, ptr );
fclose(ptr);
EDIT:
if the array was null would that also count as an empty array?