Add two put

This commit is contained in:
Aoran Zeng 2023-09-04 14:55:38 +08:00
parent 545c8e17f4
commit dad186a071
2 changed files with 7 additions and 2 deletions

View File

@ -2,7 +2,7 @@
* File : test_xy.c * File : test_xy.c
* Authors : Aoran Zeng <ccmywish@qq.com> * Authors : Aoran Zeng <ccmywish@qq.com>
* Created on : <2023-08-30> * Created on : <2023-08-30>
* Last modified : <2023-09-03> * Last modified : <2023-09-04>
* *
* test_xy: * test_xy:
* *
@ -15,6 +15,9 @@ int
main (int argc, char const *argv[]) main (int argc, char const *argv[])
{ {
xy_useutf8(); xy_useutf8();
puti(3);
double dbl = 3.1415;
putf(dbl);
puts(xy_2strjoin("Xi", "'an")); puts(xy_2strjoin("Xi", "'an"));
puts(xy_strjoin (2, "Xi", "'an")); puts(xy_strjoin (2, "Xi", "'an"));
puts(xy_strjoin(3, "屈身守分,", "以待天时,", "不可与命争也")); puts(xy_strjoin(3, "屈身守分,", "以待天时,", "不可与命争也"));

4
xy.h
View File

@ -2,7 +2,7 @@
* File : xy.h * File : xy.h
* Authors : Aoran Zeng <ccmywish@qq.com> * Authors : Aoran Zeng <ccmywish@qq.com>
* Created on : <2023-08-28> * Created on : <2023-08-28>
* Last modified : <2023-09-03> * Last modified : <2023-09-04>
* *
* xy: * xy:
* *
@ -69,6 +69,8 @@
#endif #endif
#define putf(n) printf("%f\n", n)
#define puti(n) printf("%d\n", n)
#define xy_arylen(x) (sizeof(x) / sizeof(x[0])) #define xy_arylen(x) (sizeof(x) / sizeof(x[0]))