C语言遇到的小问题

堆栈区内存大小,2M或者4M,如果char够用,你就按照char去开,就只有int的1/4啦

printf("%s",s[i])不能运行

case 's':
s = va_arg(args, char *);
if (!s)    s = "<NULL>";
len = strnlen(s, precision);
if (!(flags & LEFT)) while (len < field_width--) *str++ = ' ';
for (i = 0; i < len; ++i) *str++ = *s++;
while (len < field_width--) *str++ = ' ';

给定字符就会访问字符所在ascii值得内存空间,就炸了

猜你喜欢

转载自www.cnblogs.com/BobHuang/p/10810143.html
今日推荐