I am facing a weird problem when i try to write the contents of a char array into a file.
I first do:
here, buf points to the starting location of my char array...
fprintf( fp1 ,"%s" , buf);
the contents of this array will be re-written during the execution , and so, to transfer the new content into a file I do :
again , here buf points to the start ...
fprintf( fp1 ,"%s",buf);
the problem is : after the execution , when i open the file with "cat" , the contents of the file is displayed correctly..
when i open it thru a text editor, I see non-ascii characters at the end of each line