0

Unable to create output file

16th Apr 2022, 4:32 PM
rugved kulkarni
2 Answers
0
What have you tried? And it probably won't work in the Solo playground.
16th Apr 2022, 4:35 PM
William Owens
William Owens - avatar
0
size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream); Here is the signature to write to a file. #include<stdio.h> int main () { FILE *fp; char str[] = "Write this to file."; fp = fopen( "file.txt" , "w" ); fwrite(str , 1 , sizeof(str) , fp ); fclose(fp); return(0); } This is the basic open file and write to it example.
16th Apr 2022, 4:38 PM
William Owens
William Owens - avatar