小编Cap*_*owl的帖子

我的程序在不同的机器上提供不同的输出..!

#include<iostream>
#include<string.h>
#include<stdio.h>


int main()
{
    char left[4];
    for(int i=0; i<4; i++)
    {
        left[i]='0';
    }
    char str[10];
    gets(str);
    strcat(left,str);
    puts(left);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

对于任何输入,它应该连接0000与该字符串,但在一台电脑上它显示"0000"和输入字符串之间的菱形标志......!

c c++ string concatenation

6
推荐指数
1
解决办法
607
查看次数

标签 统计

c ×1

c++ ×1

concatenation ×1

string ×1