#include #include using namespace std; //myFile_fwrite1.cpp void readfile(char *); int main() { FILE * fp, *fp1; char str1[] = { "This is a test with fwrite " }; char *filename= "fwrite_Text1.txt"; fp = fopen(filename, "wb"); if(fp==NULL) {cout<<"\n eror in opeing file"; exit(1);} //fputs("this is fflush test",fp); fwrite(str1,26,sizeof(char),fp); fclose(fp); cout<<"\n"; readfile(filename); return 0; } // void readfile(char *str2) { FILE *fp; char str[128]; // file open with read fp = fopen ( str2 , "r" ); while(!feof(fp)) { if(fgets(str, 126, fp)) cout<< str; } fclose(fp); }