Skip to content

Instantly share code, notes, and snippets.

@vxcute
Last active April 2, 2021 22:54
Show Gist options
  • Save vxcute/828582bf67f1f9a755c29a346a65b26b to your computer and use it in GitHub Desktop.
Save vxcute/828582bf67f1f9a755c29a346a65b26b to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdnoreturn.h>
// https://godbolt.org/z/Pqv8YTPWc
int main(){
noreturn void 🀯(){printf("C Is Cool");} // noreturn means that function when called will never return and code after it won't be executed even when return statement is executed in it + nested functions are allowed
volatile const char * 🧠= "brain"; // works with clang
volatile register int πŸ˜ƒ = 1337, πŸ˜‚ = 20, 🀣 = 10, πŸ˜‡ = 0, 😳 = 90;
const register int πŸ˜› = 0x777466; // "wtf" in hex
int 🩸[] = {πŸ˜ƒ,πŸ˜›,πŸ˜‚,🀣,πŸ˜‡,😳};
int πŸ‘…[6];
for(int i = 0; i < 6; i++)
{
πŸ‘…[i] = 🩸[i]^0x1337;
}
for(int i = 0 ; i < 6; i++)
{
printf("%d\n",πŸ‘…[i]);
}
πŸ˜ƒ*=2;
🀯();
printf("%d", πŸ˜ƒ+πŸ˜›); // this will never be executed because 🀯() won't return
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment