How to compare 2 integers without getting warnings?

I have a variable Player1Visitsthat is declared as int.

If I try to compare this to 1, using Player1Visits == 1, I get a comparison warning between integer and pointer. Should I use a different type?

+3
source share
3 answers

Don't you want to compare:

*Player1Visits == 1
+2
source

, Player1Visits; , int. , @aronchick, Player1Visits - int* ( int), :

*Player1Visits == 1

, Player1Visits - - int, , :

[Player1Visits someIntProperty] == 1

( , Objective-C, ( ) , IDE.)

+4

int, . , NSInteger *Player1Visits; int *Player1Visits;.

, *.

+3

Source: https://habr.com/ru/post/1728118/


All Articles