Created
May 25, 2016 05:35
-
-
Save shichao-an/962dc6f27da887a03efebced1f77f487 to your computer and use it in GitHub Desktop.
typeof
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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