一个不知长度的数组,用devc++怎么跑不出来
#include <stdio.h>#include <stdlib.h>
#define MAXNUMBER 256
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
char buf[MAXNUMBER];
int m,i=0,j=0;
printf("请输入整数m:\n");
scanf("%d",&m);
printf("请输入字符:\n");
do{
scanf("%s",&buf[i]);
i++;
}while(buf[i-1]!='\n');
printf("%s\n",buf);
return 0;
}
这个哪里有问题呢?