lot of work has been done, but lists are currently broken
[svn/Cll1h/.git] / demos / ansi-c / print-c99.c
diff --git a/demos/ansi-c/print-c99.c b/demos/ansi-c/print-c99.c
new file mode 100644 (file)
index 0000000..7abbb16
--- /dev/null
@@ -0,0 +1,12 @@
+#include <stdarg.h>
+#include <stdio.h>
+
+void _echo(char *s, ... ) { va_list ap; for(va_start(ap,s);s;s=va_arg(ap,char *)) fputs(s,stdout); va_end(ap); }
+#define print(...) _echo(__VA_ARGS__,"\n",NULL)
+#define echo(...) _echo(__VA_ARGS__,NULL)
+
+int main(void)
+{
+ echo("Hello ","world","! ");
+ print("Hello ","world","! ");
+}
This page took 0.09923 seconds and 4 git commands to generate.