From 8b08a0143ae08935d92326003d0d66eca76cd70e Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Wed, 22 Mar 2023 21:17:14 +0800 Subject: [PATCH] add ../examples/print.c --- examples/print.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/print.c diff --git a/examples/print.c b/examples/print.c new file mode 100644 index 0000000..b31498e --- /dev/null +++ b/examples/print.c @@ -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; +} + -- 2.25.1