Created
March 25, 2015 00:53
-
-
Save anonymous/3982b0a769cb53bc2297 to your computer and use it in GitHub Desktop.
detectCollision - why do I need to check for object == NULL before strcmp?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GObject object = detectCollision(window, ball); | |
if (object == paddle) | |
{ | |
//**this if works fine without checking for object == NULL*** | |
ydisp = -ydisp; | |
} | |
if (object == NULL) | |
{ | |
//***Why do I need to check if object == NULL in order for te next if (strcmp) to work? *** | |
} | |
else if | |
{strcmp(getType(object), "GRect") ==0) | |
{ | |
if (object != paddle) | |
{ | |
ydisp = -ydisp; | |
removeGWindow(window, object); | |
etc | |
etc | |
} } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment