Add examples for keyboard input.
[libmalice.git] / demo-input-int.c
diff --git a/demo-input-int.c b/demo-input-int.c
new file mode 100644 (file)
index 0000000..aa1330d
--- /dev/null
@@ -0,0 +1,17 @@
+#include "libmalice.h"
+
+int lmMain(void)
+{
+  int i;
+
+  lmPrintString("This demo tests keyboard input for integers.\n");
+
+  lmPrintString("Enter a number and press return: ");
+  i = lmReadInt32s();
+  lmPrintString("You entered the number ");
+  lmPrintInt32s(i);
+  lmPrintChar('.');
+  lmPrintChar('\n');
+
+  return 0;
+}