c++ forbids comparison between pointer and integer

char a[2] defines an array of char's. a is a pointer to the memory at 
  the beginning of the array and using == won't actually compare the 
  contents of a with 'ab' because they aren't actually the same types,
  'ab' is integer type. Also 'ab' should be "ab" otherwise you'll have 
  problems here too. To compare arrays of char you'd want to use strcmp.

Something that might be illustrative is looking at the typeid of 'ab':

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
c++ error forbids comparison between pointer and integer rror: ISO C++ forbids comparison between pointer and integer [-fpermissive] C++ forbids comparison between pointer and integer [-fpermissive] ] C++ forbids comparison between pointer and integer [-fpermissive] C++ forbids comparison between pointer and integer [-fpermissive] |error: ISO C++ forbids comparison between pointer and integer [-fpermissive]| ISO C++ forbids comparison between pointer and integer [-fpermissive] if(i==" "){ ^ SO C++ forbids comparison between pointer and integer -fpermissive] c++ forbids comparison between pointer and integer -fpermissive SO C++ forbids comparison between pointer and integer [-fpermissive]| forbids comparison between pointer and integer C++ forbids comparison between pointer and integ 15 16 F:\6th Sem\Compilers\Q5_test.cpp [Error] ISO C++ forbids comparison between pointer and integer [-fpermissive] string ISO C++ forbids comparison between pointer and integer how to compare comparison between pointer and integer in c++ forbids iss c++ forbids comparison between pointer and integer forbids comparison between pointer and integer [-fpermissive] C++ forbids comparison between pointer and integer [-fpermissive]| error: ISO C++ forbids comparison between pointer and integer SO C++ forbids comparison between pointer and integer define cpp forbids the comparison between pointer and int error: ISO C++ forbids comparison between pointer and integer [-fpermissive error iso c++ forbids comparison between pointer and integer fpermissive 9 12 C:\Users\vaibhavdiwan\Documents\32..cpp [Error] ISO C++ forbids comparison between pointer and integer [-fpermissive] 13 12 C:\Users\vaibhavdiwan\Documents\24..cpp [Error] ISO C++ forbids comparison between pointer and integer [-fpermissive] [Error] ISO C++ forbids comparison between pointer and integer [-fpermissive] error: ISO C++ forbids comparison between pointer and integer [-fpermissive]| error: ISO C++ forbids comparison between pointer and integer [-fpermissive] ISO C++ forbids comparison between pointer and integer ISO C++ forbids comparison between pointer and integer [-fpermissive] c++ forbids comparison between pointer and integer
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source