Skip to content

Instantly share code, notes, and snippets.

@ryanseys
Created January 20, 2013 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanseys/4580876 to your computer and use it in GitHub Desktop.
Save ryanseys/4580876 to your computer and use it in GitHub Desktop.
Print string using no loops in C
#include <stdio.h>
void print_s(const char * s) {
if(*s != 0) {
putchar(*s);
print_s(s+1);
}
}
int main() {
print_s("Hello World!\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment