objective c - Need to use BOOL* instead of BOOL -


i making chess game in objective-c. in game need use bool* instead of bool because need pointer boolean variable. when try use bool*, gives me warning when try this:

bool *iswhiteturn; iswhiteturn = yes; 

the warning is:

incompatible integer pointer conversion assigning 'bool *' (aka 'signed char *') 'bool' (aka 'signed char')

as became apparent in comments, have function taking bool * parameter, example

void foo(bool *boolptr) {     *boolptr = no; } 

and need pass address of bool variable function:

bool iswhiteturn = yes; foo(&iswhiteturn); // iswhiteturn == no 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -