r/ProgrammerHumor • • 21d ago

Meme poohWritesCpp

Post image
950 Upvotes

95 comments sorted by

View all comments

Show parent comment

2

u/K722003 18d ago

You cant do this, cuz auto is a keyword. You'll probably run into a unqualified id error when trying to compile it. C++ doesn't let you make keywords into variables. The closest way to "shadow" a keyword is by using a define macro, for example something we do in like codeforces is to #define int int64_t (and do signed main() instead) so that we just don't have to worry about integer overflow issues.