I know that
fwrite(&variable,sizeof(datatype),<count>,<filepointer>);
writes data onto a binary file. But what if I want to write the character 'c' directly into the binary file (without using a buffer variable). I can't put,
fwrite(&'c',sizeof(datatype),<count>,<filepointer>);
is this possible?
Use putc or fputc (both have the same signature):
int putc(int c, FILE *stream);
If you're interested in putc vs fputc check the comments below, they know it better than me :)