i'll write something for you. if you want a name for input. you use scanf();
then you'll need to declare an FILE pointer. and write a buffer from the input into the FILE.
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char input[10]; // input buffer with a capicity of 9 character + 0 terminater.
FILE *fp; // FILE datatype and a file pointer (FP).
printf("Username please: ");
scanf("%s",&input); // pointer to input. to store the input from the stdio
printf("\n Your input is %s ",input);
fp = fopen("C:\\username.txt","w+");
fprintf(fp,input);
fclose(fp);
return 0;
}