summaryrefslogtreecommitdiff
path: root/c,cc/snprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'c,cc/snprintf.c')
-rw-r--r--c,cc/snprintf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/c,cc/snprintf.c b/c,cc/snprintf.c
new file mode 100644
index 0000000..a2cf1c2
--- /dev/null
+++ b/c,cc/snprintf.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+
+int main(void)
+{
+ int foo[4] = {192, 168, 1, 1};
+ char bla[20];
+
+ snprintf(bla, 19, "%d.%d.%d.%d", foo[0], foo[1], foo[2], foo[3]);
+
+ printf("%s\n", bla);
+
+ return 0;
+}