add ../examples/print.c
authoryu.dongliang <18588496441@163.com>
Wed, 22 Mar 2023 13:17:14 +0000 (21:17 +0800)
committeryu.dongliang <18588496441@163.com>
Wed, 22 Mar 2023 13:17:14 +0000 (21:17 +0800)
examples/print.c [new file with mode: 0644]

diff --git a/examples/print.c b/examples/print.c
new file mode 100644 (file)
index 0000000..b31498e
--- /dev/null
@@ -0,0 +1,17 @@
+
+int printf(const char* fmt, ...);
+
+int main()
+{
+       char buf[1024];
+
+       float   f   = 2.71828;
+       double  d   = -3.1415926;
+       int64_t i64 = -255;
+
+       int ret = printf("i: %d, ld: %ld,  x: %x, x: %#lx, p: %p, s: %s, f: %f, d: %lf\n",
+                       100, i64, 254, 253, buf, "hello", f, -3.14);
+
+       return ret;
+}
+