Hi All,
I have wriiten a c++ code which reads different encoding format file and store in another file.But when i do any manipulation on the file,the following code does not working.
Can anybody give me the right code.Its urgent!!!!
Thanx in AdvanceCode:#include <stdio.h> #include<iostream> int main() { FILE *fp, *fw; wchar_t *buffer; if((buffer=(wchar_t *)malloc(sizeof(wchar_t))) == NULL) /* It checks the buffer for the availability of space , to avoid the problem arise due to data overflow */ { printf("Error: No enough memory\n"); getchar(); return 1; } else { fp = fopen("in2.txt","rb"); fw = fopen("output_untitled.txt","wb"); if ( fp == NULL || fw == NULL) { printf("Error: File cannot be opened\n"); getchar(); return 1; } else { while(fread(buffer,sizeof(wchar_t),1,fp) > 0) fwrite(buffer,sizeof(wchar_t),1,fw); } } getchar(); return 0; }
Samir



LinkBack URL
About LinkBacks



