0

Can anyone explain why this code not running

#include <stdio.h> #define THIS #define THAT int main() { #if THIS && THAT printf("I love beer"); #else printf("I love chicken"); #endif return 0; }

22nd Oct 2019, 6:14 AM
Preity
Preity - avatar
3 Respostas
+ 2
I think you'll want #if defined(THIS) && defined(THAT) or #ifdef THIS #ifdef THAT
22nd Oct 2019, 6:37 AM
Schindlabua
Schindlabua - avatar
+ 1
Thanks Schindlabua this worked #include <stdio.h> #define THIS #define THAT int main() { #ifdef THIS && THAT printf("I love beer"); #else printf("I love chicken"); #endif return 0; }
22nd Oct 2019, 6:42 AM
Preity
Preity - avatar
0
~ swim ~ can you help me in this
22nd Oct 2019, 6:19 AM
Preity
Preity - avatar