From 258e1b92ebbfdebefabc120969ab87c3d8b75c3d Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 15 Jun 2014 03:50:12 +0200 Subject: old c,cc examples --- c,cc/snprintf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 c,cc/snprintf.c (limited to 'c,cc/snprintf.c') 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 + + +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; +} -- cgit v1.2.3