系统编程文件部分

This commit is contained in:
lzy
2024-04-27 00:22:26 +08:00
parent eba0cbb4c4
commit 808ec80a62
10 changed files with 426 additions and 13 deletions

28
Chapter13/io/stdio/atoi.c Normal file
View File

@@ -0,0 +1,28 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
char buf[1024];
int year = 2014, month = 5, day = 13;
printf("%d-%d-%d\n", year, month, day);
sprintf(buf, "%d-%d-%d", year, month, day);
puts(buf);
#if 0
char str[] = "123456";
printf("%d\n", atoi(str));
/**
* 输出 123456
*
* 如果str是123a456
* 输出123
*
*/
#endif
exit(0);
}