Errors when trying to check conditions in if statement | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Errors when trying to check conditions in if statement

(SEE CODE) i am getting the errors, "identifier p1 is undefined" and "struct Player type name is not allowed. Please help https://code.sololearn.com/c7vvqV0Tu0gS/#cpp

28th Apr 2018, 9:05 PM
Nislo Mislo
Nislo Mislo - avatar
3 Answers
+ 1
You need to check wether the type of p1 is Player, this is done ysing typeid function located in typeinfo library. And p1 should not be initialized in an if statement. https://code.sololearn.com/cZ9GV9IVWOQI/?ref=app
28th Apr 2018, 9:15 PM
Bebida Roja
Bebida Roja - avatar
0
its still says identifier p1 undefined
28th Apr 2018, 9:29 PM
Nislo Mislo
Nislo Mislo - avatar
0
Try to get it from another person then.
28th Apr 2018, 11:55 PM
Bebida Roja
Bebida Roja - avatar