Skip to content

Instantly share code, notes, and snippets.

@shichao-an shichao-an/typeof.c
Created May 25, 2016

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.