please tell me how to read in a .JPEG file, and rewrite it using a different filename? Please help...
Originally posted by happyhappy:
please tell me how to read in a .JPEG file, and rewrite it using a different filename? Please help...
Oh... how about something like:
FILE *in, *out;
char buff[1024];
in = fopen("mypic.jpg", "rb");
out = fopen("mypic2.jpg", "wb");
while (fread(buff, sizeof(buff), 1, in) > 0)
{
fwrite(buff, sizeof(buff), 1, out);
}
fclose(in);
fclose(out);
That's just off the top of my head, so, watch for bugs.
JoeMac
02-22-2001, 03:40 AM
If all you need is a copy, you could try
system("copy file.jpg newfile.jpg");
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.