Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Create a file and write text into it
- //Reading contents from file =>http://pastebin.com/B2iPuTuc
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- FILE *test;
- char *str;
- test=fopen("test.txt","w+");
- fputs("This is the text stored in test.txt",test);
- if(fgets(str,60,test)!=NULL)
- puts(str);
- fclose(test);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement