So you think you know C? (2016)
wordsandbuttons.online
So you think you know C? (2016)
1–10 of 344 posts
Re: So you think you know C? (2016)
#2Re: So you think you know C? (2016)
#3Re: So you think you know C? (2016)
#4Re: So you think you know C? (2016)
#5Re: So you think you know C? (2016)
#6Re: So you think you know C? (2016)
#7tl;dr - C has some undefined behavior, if you plan on things working based on your experience with one compiler and one computer, you will be surprised.
Re: So you think you know C? (2016)
#8Re: So you think you know C? (2016)
#9One immediate redflag I have noticed is using "int", "char", "short" as if they have a definite size. They don't. C standard only guarantees a minimum size. For example, many PDPs are 36-bit. Assuming the size of a variable is a common practice nowadays, but at least one should use uint8_t, int32_t, etc. from stdint.h.
But I was still tricked, it should be obvious in hindsight, 12 years of schooling led me to think: If the author was asking these questions, at least one or two questions must be answerable (even if it's technically incorrect, but you'd better to guess the original intention of a question). So I still tried to guess and got two wrong answers... Get to be careful next time...