Jump to content

invalid operands to binary expression


Recommended Posts

NULL is of type "pointer" bool is either true or false comparing them makes no sense..
how i solve it right now ?

questlua_petnew.cpp:135:12: error: invalid operands to binary expression
      ('nullptr_t' and 'int')
                if (NULL == petActor)
                    ~~~~ ^  ~~~~~~~~
questlua_petnew.cpp:155:12: error: invalid operands to binary expression
      ('nullptr_t' and 'int')
                if (NULL == petActor)
                    ~~~~ ^  ~~~~~~~~
questlua_petnew.cpp:174:12: error: invalid operands to binary expression
      ('nullptr_t' and 'int')
                if (NULL == pet_level)
                    ~~~~ ^  ~~~~~~~~~
questlua_petnew.cpp:194:12: error: invalid operands to binary expression
      ('nullptr_t' and 'int')
                if (NULL == pet_evo)
                    ~~~~ ^  ~~~~~~~
4 errors generated.
gmake: *** [Makefile:96: .obj/questlua_petnew.o] Error 1

questlua_petnew.cpp - https://pastebin.com/PAp4FNtU

Link to comment
Share on other sites

  • Silver

Am Bsp. von pet_evo erklärt.

Dein Compiler sagt ja, er kann nullpointer (NULL) nicht mit int (pet_evo) vergleichen.

Is ja auch richtig.

Als was is pet_evo definiert ?

int pet_evo = petSystem->GetEvolution();

Ah ein int. Was gibt GetEvolution zurück ?

DWORD            GetEvolution() { return m_dwevolution; }

Passt also auch :D

 

Was ist zu tun ?

if (0 == pet_evo)

 

  • Love 4
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.