Thread: what -> mean in if statement?

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    51

    what -> mean in if statement?

    Order order[100]
    has is one function in class Order.

    for (int i = 0; i < noOrders && index == -1; i++)
    if (order[i]->has(isbn))
    index = i;


    I tried to look up google for the -> but it didnt work.

    thank you.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    It means the same thing it means anywhere else, that you are getting at a member (of either a struct or a class), but from a pointer instead of an object.

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    51
    is that the same as order[i].has(isbn)?

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    It does the same thing that . does, but for a pointer instead of an object.

  5. #5
    Registered User
    Join Date
    Jun 2011
    Posts
    51
    thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OR statement in C
    By Keylac in forum C Programming
    Replies: 8
    Last Post: 11-26-2009, 09:09 AM
  2. Statement inside a statement.
    By JOZZY& Wakko in forum C Programming
    Replies: 15
    Last Post: 11-05-2009, 03:18 PM
  3. if statement, i need help
    By joze in forum C Programming
    Replies: 18
    Last Post: 04-15-2008, 05:21 AM
  4. If Statement
    By boontune in forum C++ Programming
    Replies: 2
    Last Post: 09-17-2003, 07:56 AM
  5. if statement
    By ZakkWylde969 in forum C++ Programming
    Replies: 22
    Last Post: 07-11-2003, 10:48 PM