Comment

Comment by user2994cb

If you don't like those hard-coded character constants, lack of newlines, and compiler warnings, here's a C quine on similar lines:

  #include<stdio.h>
  int main(){
    char q='"',n='\n',b='\\';
    char*f="#include<stdio.h>%cint main(){%c  char q='%c',n='%cn',b='%c%c';%c  char*f=%c%s%c;%c  printf(f,n,n,q,b,b,b,n,q,f,q,n,n,n);%c}%c";
    printf(f,n,n,q,b,b,b,n,q,f,q,n,n,n);
  }
parent user2994cb 4 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton