« Back

URL in C

An interesting C puzzle I read weeks ago, maybe you might find it amusing.

Did you know that URLs are a valid syntactic element in C? Maybe the syntax highlighting will give you a hint :)

#include <stdio.h>

int main()
{
    https://wildauer.io/
    printf("hello, world\n");
    return 0;
}
~  gcc hello.c -o hello && ./hello
hello, world

The code compiles and runs successfully, because https: is a label and // following begins a comment.