So my instructor has a penchant for asking tricky questions, last day he asked how to print Hello, World in C without typing a single semicolon. There are several answers to this like the if/while/switch statements or printing inside the argument of the main function. However one answer I found on a site was way different, he talked about stealing a semicolon from a header file. Here's the code:
Can you Please explain me how this works? I know uint8_t is a byte representation but still I have no clue. I also read that this doesn't work on FreeBSD. Why so?
Thanks.
int main(int ac, char **av)
{
#define typedef
#define uint8_t a[printf("Hello, World\n")]
#include <stdint.h>
}
Can you Please explain me how this works? I know uint8_t is a byte representation but still I have no clue. I also read that this doesn't work on FreeBSD. Why so?
Thanks.