 |
1樓
巨大八爪鱼
2015-10-15 22:02
#include <stdio.h>
void main() { FILE *fp; unsigned int map_id; char file_name[500];
printf("Please input the ID of the map: \n"); scanf("%d", &map_id); if (map_id > 999) map_id = 999; sprintf(file_name, "Map%03d.rxdata", map_id); printf("The file name is \"%s\".\n", file_name); fp = fopen(file_name, "ab"); fwrite(&map_id, sizeof(map_id), 1, fp); fclose(fp); printf("File created and written.\n"); }
|
 |
2樓
巨大八爪鱼
2015-10-15 22:02
我终于知道魔塔样板中的公共事件 -> 上下楼中的Map%03d.rxdata到底是什么意思了。
|
 |
3樓
巨大八爪鱼
2015-10-15 22:41
#include <stdio.h>
void main() { //printf("%c%c%c%s%c%c%c%c", '\'', 'a', '\'', " is not ", '"', 'a', '\"', '\n'); /*putchar('\''); putchar('"'); printf("'\n");*/
putchar(0x44); putchar(0x44); putchar(68); putchar(0104); putchar('\104');
putchar('\n');
printf("%c%C\n", 'a', 'S'); //aS printf("%c%c%c%c\n", '1', '2', '\r', '3'); //32 printf("%c%c%c%c\n", '1', '2', '\b', '3'); //13 printf("12\r3\n"); //32 printf("%#x\n", '\x6f'); printf("%#o, %c, map%010d.rxdata\n", 47, 97, 97); printf("%-6d{% d,% d}\n", 97, 784, -1325); }
|
 |
4樓
巨大八爪鱼
2015-10-16 22:46
今天老师讲了getchar系列函数
|