Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

To copy a jpeg file in C++

62 views
Skip to first unread message

Duygu Isik

unread,
Jun 14, 2002, 5:51:06 AM6/14/02
to
Can anyone help me with how to copy a jpeg file locating
somewhere in the harddrive to another location on the
hard drive in c++ language

Serge Castelier

unread,
Jun 14, 2002, 5:58:06 AM6/14/02
to
You can use CopyFile()

I hope this will help you

Serge

"Duygu Isik" <jo...@dos.ac> a écrit dans le message news:
d08401c21389$00b08190$a4e62ecf@tkmsftngxa06...

Anders M Eriksson

unread,
Jun 14, 2002, 7:22:53 AM6/14/02
to

Since you are only copying the file it doesn't matter that it is a
jpeg file! Just open the file for read, create a new file on the
destination and read the old and write the new. NB! remeber to open
the file as a binary file.

or you can use the windows api
BOOL CopyFile(
LPCTSTR lpExistingFileName,
// pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);

// Anders

0 new messages