数组越界不报错,这是神马问题呢?

贪玩好耍调皮捣蛋 2013-09-07 10:03:21
/*******************************************************************
*第二个版本(申明全局变量)
*******************************************************************/
#include <stdio.h>

char outbuf[50];

int main(void)
{
int s=0;

/* 将outbuf与stdout输出流相连接 */
setbuf(stdout,outbuf);

/* 向stdout中放入一些字符串 */
puts("This is a test of buffered output.");
puts("This output will go into outbuf");
puts("and won't appear until the buffer");
puts("fills up or we flush the stream.\n");

/* 以下是outbuf中的内容 */
puts(outbuf);

/* 刷新流 */
fflush(stdout);

/* 打印数组包含的内容 */
for(s=0;s<50;s++)
{
printf("%c",outbuf[s]);
}
printf("\n");
return 0;
}
...全文
78 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

70,037

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧