Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of evaluation of parameters... #3

Open
gtoal opened this issue Sep 23, 2024 · 0 comments
Open

Order of evaluation of parameters... #3

gtoal opened this issue Sep 23, 2024 · 0 comments

Comments

@gtoal
Copy link

gtoal commented Sep 23, 2024

printf("Compressed (%i): %u, decompressed: (%u)\n", i, 
 file_lz77_compress("./lz.c", "lz.c.z77", 10000000, i),
 file_lz77_decompress("./lz.c.z77", "lz-2.c"))

C evaluates parameters right-to-left, so decompress gets called before compress, with the result that the correct values are only ever printed if you run the code twice in a row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant