This post is mostly a quick reference to keep me from shooting myself in the foot again.
Comma operator
C has a binary operator that evalutes both its argument and discards the result of the first expression.
Try it on Compiler Explorer 🗗
Works with function calls too:
Try it on Compiler Explorer 🗗
And, works with more than two values:
Try it on Compiler Explorer 🗗
typedef-ing a pointer (C++)
const
modifier on a typedef
-ed pointer is different than
typedef
-ed const pointer.
Try it on Compiler Explorer 🗗
const int*
is a pointer to a constant int, while const ptr
is a constant pointer to an int.