diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-07 23:33:14 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-07 23:33:14 +0000 |
commit | df39877168f832a31688dd8e6ab9829257c10d14 (patch) | |
tree | d7d69ff79740e33a7f84af02816612ffe676c1ab /wk4/pset | |
parent | b99ea0ad6e4f21b0a90022fd28014ab8cf2ad2e2 (diff) |
Sun, Apr 7, 2024, 4:33 PM -07:00
Diffstat (limited to 'wk4/pset')
-rw-r--r-- | wk4/pset/recover/recover.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/wk4/pset/recover/recover.c b/wk4/pset/recover/recover.c index 69d6adc..1b48b1c 100644 --- a/wk4/pset/recover/recover.c +++ b/wk4/pset/recover/recover.c @@ -42,10 +42,15 @@ int main(int argc, char *argv[]) filename = files.jpg files++ Open output file with name (filename) - Copy data from old to new file --> + + // make buffer space to store the data uint32_t data[photolength][16]; - fread(&data, sizeof(uint32_t), 16 * photolength, inptr) - fwrite() + // read the photo to data in blocks of 32 bits + fread(&data, sizeof(uint32_t), 16 * photolength, inptr); + // write the photo from data + fwrite(&data, sizeof(uint32_t), 16 * photolength, point); + // Close the photo file + // repeat this process for other photos } } |