Skip to content

Instantly share code, notes, and snippets.

@kerolasa
Created February 9, 2019 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerolasa/9a2654c27334490e1ba637cebce73f5e to your computer and use it in GitHub Desktop.
Save kerolasa/9a2654c27334490e1ba637cebce73f5e to your computer and use it in GitHub Desktop.
C comma operator
#include <stdio.h>
int main(void)
{
int a = 1;
int b = 2;
int c = 3;
int y = a >= (4, b);
int x = c >= (5, b);
printf("%d\n", y);
printf("%d\n", x);
return 0;
}
/* See also https://mindtribe.com/2011/07/forgotten-c-the-comma-operator/ */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment