Re: How to Open a File In Binary Mode using fopen
- From: "James Brown [MVP]" <not@home>
- Date: Tue, 7 Mar 2006 13:14:50 -0000
Did you read the documentation for the fopen function call at all?
James
--
Microsoft MVP - Windows SDK
www.catch22.net
Free Win32 Source and Tutorials
"Alok Singh" <alok.singh@xxxxxxxxxxxxxxx> wrote in message
news:exQt1ieQGHA.5092@xxxxxxxxxxxxxxxxxxxxxxx
Hi
i want to know how can i open a file using fopen in vc++ win32 console
application in binary mode.
It is mandatory to use fopen only.
Actually what i have to do is to read from an existing file and copy it in
another file.
The existing File is "file1.doc" means the file is of doc type.
the code listed below is reading from the existing file , it is making a
new
file of desired length , it is showing unexpectable characters in that new
generated file and this is the problem HOW
CAN WE OBTAIN original characters that are in the existing DOC file in
that
newly created file.
The same code is working for a TXT file but it is not working for a DOC
file.
Please help me. I WILL BE VERY THANKFUL TO YOU.
FILE * pFile , * sFile ;
char filepath[60],filepath1[80];
cin>>filepath; //filepath of existing doc file
pFile = fopen ( filepath, "r");
cin>>filepath1; //filepath of doc file to be created
sFile = fopen ( filepath1 , "w" );
numr= fread (list,sizeof(char),629146,pFile);
numw= fwrite(list,sizeof(char),629146,sFile);
.
- References:
- How to Open a File In Binary Mode using fopen
- From: Alok Singh
- How to Open a File In Binary Mode using fopen
- Prev by Date: Re: Crash(Access violation) on using virtual function.
- Next by Date: How to Open a File In Binary Mode using fopen
- Previous by thread: How to Open a File In Binary Mode using fopen
- Next by thread: Re: How to Open a File In Binary Mode using fopen
- Index(es):
Relevant Pages
|