| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 468 人关注过本帖
标题:求解,这代码在vC6.0中运行不起来,明明是按书上一行一行抄下来的。
取消只看楼主 加入收藏
夜十天
Rank: 1
等 级:新手上路
帖 子:32
专家分:7
注 册:2013-5-8
结帖率:62.5%
收藏
已结贴  问题点数:20 回复次数:0 
求解,这代码在vC6.0中运行不起来,明明是按书上一行一行抄下来的。
#include "stdafx.h"
#include "iostream"
#include "string"
int main()
{   using namespace std;
    char charr1[20];
    char charr2[20];
    string str1;
    string str2="panther";
    cout<<"Enter a kind of feline:"<<endl;
    cin>>charr1;
    cout<<"Enter another kind of feline:"<<endl;
    cin>>str1;
    cout<<"Here are some felines\n";
    cout<<charr1<<" "<<charr2<<" "<<str1<<" "<<str2<<endl;
    cout<<"The third letter in"<<charr2<<"is"<<charr2[2]<<endl;
    cout<<"The ghird letter in"<<str2<<"is">>str2[2]<<endl;
    return 0;
}
这是错误信息提醒:
D:\新建文件夹\Microsoft Visual Studio\MyProjects\999\999.cpp(20) : error C2676: binary '>>' : 'class std::basic_ostream<char,struct std::char_traits<char> >' does not define this operator or a conversion to a type acceptable to the predefined operat
or
执行 cl.exe 时出错.

999.exe - 1 error(s), 0 warning(s)
求大神。
搜索更多相关主题的帖子: another include letter Enter 
2013-11-09 11:06
快速回复:求解,这代码在vC6.0中运行不起来,明明是按书上一行一行抄下来的。
数据加载中...
 
   



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

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