CIR Playground
Load example...
CIR on GitHub
Input
Run
// In this example, we invoke strtok() at compile-time. // This demonstrates CIR's ability to use the C standard library at // compile-time. #include <stdio.h> #include <string.h> static int numWords(char *s) { int numWords = 0; for (char *p = strtok(s, " "); p; p = strtok(NULL, " ")) numWords = numWords + 1; return numWords; } int main(void) { printf("Hello World has %d words", @numWords("Hello World")); return 0; }
stdout
stderr
Load Example...
×
00 - Compile-time fibonacci
01 - Inline Repeat
02 - Compile-time strtok
03 - Does a code call a function
04 - C Preprocessor identifiers may be accidentally shadowed
05 - CIR identifiers won't be accidentally shadowed
06 - C Preprocessor accidental capture of symbols
07 - CIR won't accidentally capture symbols
08 - bf-to-C (low level ver)
09 - bf-to-C (with quote-antiquote)
10 - async-await
11 - Embed an external file
12 - zlib