奇怪的错误,也不知道错在哪里。

这段代码在dev++上可以运行,再eclipse上却有问题。比如我依次输入hello world see you later就崩溃了。不知道为什么,请大神不吝指教。谢谢

```

    #include <stdio.h>
    #include <ctype.h>

void str_toupper(char s[])     //把字符串变大写
{
    int i = 0;
    while (s[i]){
        s[i] = toupper(s[i]);
        i++;
    }
}

void put_strary(const char s[][128], int n)   //显示字符串数组
{
    int i;
    for (i=0; i<n; i++){
        int j=0;
        printf("str[%d] = \"", i);

        while (s[i][j])
            putchar(s[i][j++]);
        puts("\"");
    }
}

int main(void) {
    setvbuf(stdout, NULL,_IONBF,0);
    char str[][128] = {" "};
    int i = 0;
    int j = 0;
    int k = 0;
    do {                                           //限制输入5次
        printf("请输入字符串:");
        scanf("%s", str[j]);
        j++;
    } while (j<5);

    put_strary(str, j);
    printf("%s\n", str[4]);               //检查一下是否正常显示最后一个字符串
        for (k=0; k<5; k++)
    printf("%c\n", str[4][k]);            //打印最后一个字符串的每个字母

    printf("大写字母是:");
    for (i=0; i<j; i++){
        str_toupper(str[i]);
        printf("%s ", str[i]);
        }

    return 0;
}