1

Commands preview

When I run copy.c it creates a copy of clue.bmp but the clcp.bmp(the copy of clue.bmp) seems to differ according to diff.

But when I try to do the same with smiley.bmp it works.

2

Looks like there are "stray bytes", presumably at the end of clue.bmp. When it's opened in the IDE, clue.bmp is 640W * 480H. The filesize should be 54 + (640 * 3) * 480 which is 921,654 bytes. ls -l clue.bmp reveals that the file is 921,656 bytes. copy produces a file that is 921,654 bytes.

2
  • I appreciate ur answer but I'm very curious to know why does clue.bmp have those stray bytes whereas clcp.bmp doesn't,if it's a perfect copy, so to speak? – sk.76 Jul 5 '17 at 13:31
  • It's not a perfect copy. copy only reads/writes bytes as per the dimensions of the image. It doesn't consider the possibility that there are bytes past the end of the image. But it handles the task of reproducing the image. It might be considered a perfect copy of the image, but not of the file itself. – DinoCoderSaurus Jul 5 '17 at 14:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .