Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Write Binary File fread();
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- FILE *fp;
- size_t count;
- char str[] = "GOOD MORNING";
- clrscr();
- fp = fopen("Welcome.txt", "wb");
- if(fp==NULL)
- {
- printf("\n The file could not be opened");
- exit(1);
- }
- count = fwrite(str, strlen(str), 1, fp);
- printf("\n %d bytes were written to the files", count);
- fclose(fp);
- getch();
- }
Add Comment
Please, Sign In to add comment