[Error] ISO C++ forbids comparison between pointer and integer [-fpermiss

原创 2016年05月31日 11:35:26

错误代码:

if(a[i]=="G"&&b[i]!="C")
    return false; 

改正后的代码:

if(a[i]=='G'&&b[i]!='C')
    return false;


解释:两种不同类型的数据不能做比较,a[i]表示的是一个字符,“C”表示的是一个字符串的收地址,所以应该把“C”改为‘C’


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

A warning - comparison between signed and unsigned integer expressions [-Wsign-compare]的解决方法

源程序是 /*********************产生观测模型****************************/ void ProRobotics::GenObservations(flo...

What are the differences between a pointer variable and a reference variable in C++?

Question: I know references are syntactic sugar, so code is easier to read and write. But wh...

JNI - Divide by Zero. A comparison between Java and C(1)

A comparison of DivideByZero(c++ and Java)

A Comparison Between Haar Wavelet Transform and Fast Fourier Transform in Analyzing Financial Time S

Research Journal of Applied Sciences Year: 2010 | Volume: 5 | Issue: 5 | Page No.: 352-360 ...

文献笔记:《Fitting a 3D Morphable Model to Edges: A Comparison Between Hard and Soft Correspondences》读后感~

发一篇小文,未完待续哈!

CSharp - Comparison between IComparer and IComparable

Comparison between IComparer and IComparable

part 8: comparison between OOL and FL

OOP和函数编程的区别 表格:行是operation,列是variant 函数编程:      每个operation都是一个函数,每个函数都有若干branch,每个branch都对应一...

[dynamic FL]part 6:comparison between Dynamic and Static

各种语言的比较: Dynamic type language VS Static type language:      Dynamic看待Static: ML好像只是Racket的子集。ML会拒...

Difference between string created by array and pointer

char *getstring() { int size = 4; char *string=malloc(sizeof(char)*size; string[0] = 'H'; string[1]...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)