added a more sophisticated formatstring program
authorChristian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 10 Oct 2014 12:39:11 +0100
changeset 234 17e0efbec5d0
parent 233 5a5729358afc
child 235 75e32cd57ef0
added a more sophisticated formatstring program
progs/C5.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/progs/C5.c	Fri Oct 10 12:39:11 2014 +0100
@@ -0,0 +1,8 @@
+#include<stdio.h>
+#include<string.h>
+
+int main(int argc, char **argv)
+{  char buf [100];
+   snprintf(buf, sizeof buf, argv [1]);
+   printf ("Input: %s \n", buf);
+}