what -> mean in if statement?

This is a discussion on what -> mean in if statement? within the C++ Programming forums, part of the General Programming Boards category; Order order[100] has is one function in class Order. for (int i = 0; i < noOrders && index == ...

  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,185
    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,185
    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, 08:09 AM
  2. Statement inside a statement.
    By JOZZY& Wakko in forum C Programming
    Replies: 15
    Last Post: 11-05-2009, 02: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21