In the pre-increment operation explanation, you made a little typo.
#include <stdio.h>
int main()
{
int x, y;
x = 5;
y = ++x;
printf("x is equal to %d\n", x); // x is equal to 6
printf("y is equal to %d\n", y); // y is equal to 5 ⚠️ Should be 6 instead.
}
Hahaha you're correct, thanks for pointing that out. It seems that no matter how much you cross-check an article before posting, there are always some silly mistakes somewhere.
Loïc De Deyn
Hi Patrick,
In the pre-increment operation explanation, you made a little typo.
#include <stdio.h> int main() { int x, y; x = 5; y = ++x; printf("x is equal to %d\n", x); // x is equal to 6 printf("y is equal to %d\n", y); // y is equal to 5 ⚠️ Should be 6 instead. }Correct me if I'm wrong.
Thanks for your article by the way!