Created
March 7, 2019 20:28
-
-
Save C47D/a423a1bb6ce515fe352f9e7efb84b55a to your computer and use it in GitHub Desktop.
String concatenation
This file contains hidden or 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> | |
void test_1(void); | |
void test_2(void); | |
void test_3(void); | |
#define USE_TEST(x) (test_##x()) | |
int main(void) { | |
USE_TEST(1); | |
USE_TEST(3); | |
USE_TEST(2); | |
USE_TEST(1); | |
// Output: | |
// 1 | |
// 3 | |
// 2 | |
// 1 | |
return 0; | |
} | |
void test_1(void) | |
{ | |
printf("1\r\n"); | |
} | |
void test_2(void) | |
{ | |
printf("2\r\n"); | |
} | |
void test_3(void) | |
{ | |
printf("3\r\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment