Source: https://mokxi.com/errors/comparison-between-pointer-and-integer
Updated: 2026-11-16

Home / Errors
Arduino build error

# error: ISO C++ forbids comparison between pointer and integer [-fpermissive]

A piece of text, a char array or a string literal, is a pointer. A single character or a number is an integer. They cannot be compared with ==.

Try the fixed sketch in Mokxi See the causes

- Build error
- 2 common causes
- Seen 487 times in failed builds on Mokxi in the 30 days to November 16, 2026.

The message

## What the Arduino IDE prints

Output window

Compare one character with one character, or compare text with strcmp() or a String.

Mokxi's compiler, clang, words it as comparison between pointer and integer.

Causes

## The 2 usual causes with the fix

### 1A whole word is compared with one character

'a' is one character. word is a row of them. Compare one item of the row, or compare the whole word with strcmp.

Broken

Fixed

Mokxi’s build tab says: Text in quotes, or a char array, is a pointer

Try this fix in Mokxi

### 2A number is compared with text in quotes

The quotes make "5" text. A number needs no quotes.

Broken

Fixed

Mokxi’s build tab says: Text in quotes, or a char array, is a pointer

Try this fix in Mokxi

FAQ

## Questions and answers

### How do I compare two pieces of text?

With strcmp(a, b) == 0 for char arrays, or == between two Strings.

### What is the difference between 'a' and "a"?

'a' is one character. "a" is text: the letter and a zero that ends it.

### Why does == on char arrays not work?

It compares where the arrays are in memory, not what they hold. Use strcmp.

Next

## More errors and the longer guide

- error: cannot convert 'String' to 'const char*'
- error: invalid operands of types 'const char [6]' and 'const char [6]' to binary 'operator+'

Every Arduino compile error All Arduino errors
