+ 2
What is wrong in following code ? error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
void store(string line){ this->line=line; cout<<typeid(line[0]).name(); if(line[0]=="<" && line[1)=="/"){ // line[1) changed to line[1] still error occurs } else{ this->getTag(); this->attribute(); this->attributeVal(); cout<<tag<<endl<<attribute_name<<endl<<attributeValue; t1=make_tuple(tag,attribute_name,attributeValue); } } //error: ISO C++ forbids comparison between pointer and integer [-fpermissive] // function is member function
5 Answers
+ 1
line[0] == '<'
use single quote for char..double quote means literal string(const char*)
+ 4
line[1)
Shouldnt it be a closing square bracket instead of closin parenthesis 🤔
+ 2
You are missing a right bracket in line 4.
I don't see any other problems - at a quick glance.
+ 1
Still it I got error:
ISO C++ forbids comparison between pointer and integer
0
Thank for your support guys 👏👏