随笔分类 -  The C programming Language

replace tabs with the proper number of blanks
摘要:/* 1-20. Write a program detab that replaces tabs in the input with the proper number of blanks to space to the next tab stop. Assume a fixed set of tab stops, say every n columns. Should n be a v... 阅读全文

posted @ 2011-10-12 22:36 skynjupt 阅读(323) 评论(0) 推荐(0)

带有可变参数表的简化的printf函数
摘要:#include <stdio.h>#include <stdarg.h>/* minprintf函数: 带有可变参数表的简化的printf函数 */void minprintf(char *fmt,...){ va_list ap; /* 将ap指向第一个无名参数 */ char *p, *sval; int ival; double dval; va_start(ap, fmt); for(p = fmt; *p; p++) { if(*p != '%') { putchar(*p); continue; } switch (*++p) { case 阅读全文

posted @ 2011-09-24 09:28 skynjupt 阅读(361) 评论(0) 推荐(0)

导航