Can I pass a character array to
s must be a null terminated character array.
The man pages confirm this
FILE *fopen(const char *path, const char *mode);
You can see that it must be null terminated, since no size argument is given.