Skip to content

Instantly share code, notes, and snippets.

@shichao-an
Created May 25, 2016 05:35
Embed
What would you like to do?
typeof
#include <stdio.h>
#include <stdlib.h>
#define test(x) ({ \
typeof(x) _x = (x); \
_x += 1; \
_x; \
})
int main(int argc, char* argv[])
{
float f = 0.5F;
float f2 = test(f);
printf("%f\n", f2);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment