From: yu.dongliang <18588496441@163.com> Date: Wed, 22 Mar 2023 13:17:14 +0000 (+0800) Subject: add ../examples/print.c X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=8b08a0143ae08935d92326003d0d66eca76cd70e;p=scf.git add ../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; +} +