C

Asked • 03/15/19

Why does sizeof(x++) not increment x?

Here is the code compiled in dev c++ windows: #include int main() { int x = 5; printf("%d and ", sizeof(x++)); // note 1 printf("%d\\n", x); // note 2 return 0; }I expect `x` to be 6 after executing **note 1**. However, the output is: 4 and 5Can anyone explain why `x` does not increment after **note 1**?

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.