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

Page 41: %zu is a better format specifier for size_t than %zd #93

Closed
delan opened this issue Jan 3, 2020 · 1 comment
Closed

Page 41: %zu is a better format specifier for size_t than %zd #93

delan opened this issue Jan 3, 2020 · 1 comment

Comments

@delan
Copy link

delan commented Jan 3, 2020

size_t is an unsigned type, so %zd would be misleading for many values:

#include <cstdint>
#include <cstdio>
int main() { printf("%zd", SIZE_MAX); }
@JLospinoso
Copy link
Owner

Thanks @delan! This is a pretty major erratum. I've added a note for the first occurrence on Page 41, but it needs to be fixed all over the place.

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

2 participants