2 Replies - 143 Views - Last Post: 13 July 2012 - 10:22 AM Rate Topic: -----

#1 Tom_Leonardsson  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 67
  • Joined: 07-August 11

C++ error "|12|error: expected primary-expression before '&

Posted 13 July 2012 - 09:55 AM

Hi!

I get an error and I don't know how to fix it.
Here's the code that I get errors in.
   bool collision(SDL_Rect* pal, SDL_Rect* sprite)
    {
         if(sprite->y= > pal->y + pal->h)
         return 0;
        return 1;
    }



And this is the error:
|12|error: expected primary-expression before '>' token|


Thanks for any help! :bigsmile:

Is This A Good Question/Topic? 0
  • +

Replies To: C++ error "|12|error: expected primary-expression before '&

#2 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 1418
  • View blog
  • Posts: 2,681
  • Joined: 30-May 10

Re: C++ error "|12|error: expected primary-expression before '&

Posted 13 July 2012 - 10:02 AM

> if(sprite->y= > pal->y + pal->h)
Are you trying to write >= ?
Was This Post Helpful? 1
  • +
  • -

#3 Tom_Leonardsson  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 67
  • Joined: 07-August 11

Re: C++ error "|12|error: expected primary-expression before '&

Posted 13 July 2012 - 10:22 AM

View PostSalem_c, on 13 July 2012 - 10:02 AM, said:

> if(sprite->y= > pal->y + pal->h)
Are you trying to write >= ?


Yhee thanks for the help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1