| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 5280 人关注过本帖
标题:no operator defined which takes a right-hand operand of type 'const ch ...
只看楼主 加入收藏
蔡君君
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2016-10-31
结帖率:100%
收藏
已结贴  问题点数:15 回复次数:5 
no operator defined which takes a right-hand operand of type 'const char' (or th
#include <iostream.h>
int maxmum(int ia[5][4]);

int main()
{
int a[5][4];
int i,j,m,n;
cout <<"please input grade:";
for(i=0;i<5;i++)
{for(j=0;j<4;j++)
      cin >>a[i][i]>>' ';
      cout <<a[i][j]<<' ';
cout<<endl;
}
maxmum(a);
 


}
int maxmum(int ia[5][4])                  
{
int i,j;
int m=0;
int n=0;
int max=0;
for(i=0;i<5;i++)
  for(j=0;j<4;j++)
  {
  if(ia[i][j]>max)
  {max=ia[i][j];
   m=i;
   n=j;}
  }
cout<<"student number is"<<m<<endl;
cout<<"course number is"<<n<<endl;
}
为什么它老提示:error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'const char' (or there is no acceptable conversion)
搜索更多相关主题的帖子: include please number 
2016-11-03 13:43
书生牛犊
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:星夜征程
等 级:贵宾
威 望:10
帖 子:1101
专家分:5265
注 册:2015-10-27
收藏
得分:5 
参考  https://zhidao.baidu.com/question/682334700027728092.html

φ(゜▽゜*)♪
2016-11-03 14:16
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9007
专家分:53942
注 册:2011-1-18
收藏
得分:10 
提问先,应该先将无关的代码去掉,并将代码写工整,比如你这个问题,就应该直接问
#include <iostream>
using namespace std;

int main( void )
{
    cin >> ' ';
}
报错为 error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'const char' (or there is no acceptable conversion)

2016-11-03 14:44
书生牛犊
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:星夜征程
等 级:贵宾
威 望:10
帖 子:1101
专家分:5265
注 册:2015-10-27
收藏
得分:0 
以下是引用rjsp在2016-11-3 14:44:05的发言:

提问先,应该先将无关的代码去掉,并将代码写工整,比如你这个问题,就应该直接问
我原来还以为是.h的错呢。没认真看,原来是cin<<' ';

φ(゜▽゜*)♪
2016-11-03 15:09
蔡君君
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2016-10-31
收藏
得分:0 
回复 3楼 rjsp
我把#include <iostream.h>改成#include <iostream>  
                             using namespace std;它还是提示no operator defined which takes a right-hand operand of type 'const char' (or there is no acceptable conversion)。
2016-11-03 16:50
蔡君君
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2016-10-31
收藏
得分:0 
回复 4楼 书生牛犊
??我打的是 cin>>呐
2016-11-03 16:52
快速回复:no operator defined which takes a right-hand operand of type 'con ...
数据加载中...
 
   



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

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