标题:vc++里边汉字输入不会
取消只看楼主
潘松楠
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2016-10-13
结帖率:0
已结贴  问题点数:2 回复次数:1 
vc++里边汉字输入不会

#include<stdio.h>
int main()
{
    char a[6]={小明},b[6];
        print("Please enter your name!\n");
    scanf("%c%c%c",&b[0],&b[1],&b[2]);
    if(a[0]==b[0]&&a[1]==b[1])
        printf("welcome to you!\n");
    else
        printf("Get out!\n");

    return 0;
}



--------------------Configuration: 6 - Win32 Debug--------------------

Compiling...
6.c
C:\Users\Administrator\Desktop\办公\6.c(4) : error C2018: unknown character '0xc5'
C:\Users\Administrator\Desktop\办公\6.c(4) : error C2018: unknown character '0xcb'
C:\Users\Administrator\Desktop\办公\6.c(4) : error C2059: syntax error : ','
C:\Users\Administrator\Desktop\办公\6.c(4) : error C2018: unknown character '0xcb'
C:\Users\Administrator\Desktop\办公\6.c(4) : error C2018: unknown character '0xc9'
C:\Users\Administrator\Desktop\办公\6.c(4) : error C2018: unknown character '0xe9'
C:\Users\Administrator\Desktop\办公\6.c(4) : error C2018: unknown character '0xaa'
C:\Users\Administrator\Desktop\办公\6.c(5) : warning C4013: 'print' undefined; assuming extern returning int
C:\Users\Administrator\Desktop\办公\6.c(6) : error C2065: 'b' : undeclared identifier
C:\Users\Administrator\Desktop\办公\6.c(6) : error C2109: subscript requires array or pointer type
C:\Users\Administrator\Desktop\办公\6.c(6) : error C2102: '&' requires l-value
C:\Users\Administrator\Desktop\办公\6.c(6) : error C2109: subscript requires array or pointer type
C:\Users\Administrator\Desktop\办公\6.c(6) : error C2102: '&' requires l-value
C:\Users\Administrator\Desktop\办公\6.c(6) : error C2109: subscript requires array or pointer type
C:\Users\Administrator\Desktop\办公\6.c(6) : error C2102: '&' requires l-value
C:\Users\Administrator\Desktop\办公\6.c(7) : error C2109: subscript requires array or pointer type
执行 cl.exe 时出错.

6.exe - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: character welcome 汉字输入 Desktop include 
2016-12-15 11:57
潘松楠
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2016-10-13
得分:0 
回复 2楼 renkejun1942
多谢,已经学会了。
2016-12-23 19:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-472438-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.794782 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved