Thread: Newby Question

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    9

    Newby Question

    Hey guys, i've just started c++ and was wondering if one of you guys could tell me what does the -> mean in plain simple English?

    e.g.

    Im studying DirectX 9.0 and see the following:

    D3DSURFACE DESC surfaceDesc;
    surface ->GetDesc(&surfaceDesc);

    Thanks in advance!

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Code:
    CString* p = new CString;
    *p = "this is a string";
    int length = (*p).GetLength();
    length = p->GetLength();
    The last two does the same thing. -> is usually used to access member functions on a pointer. You can read up a little about pointers since DX9 is full of them.

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    9
    Ty, makes sense

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Hey guys, i've just started c++... Im studying DirectX 9.0...
    DirectX is NOT for beginners!.

    I haven't fooled-around with DirectX that much, so I don't know exactly what the prerequisites are. Most of these advanced/special libraries require a very good understanding of variable types (and typedefs), functions, pointers, and structures. Besides that, you won't be able to do anything useful with these DirectX functions if you don't know some standard C++ too.

    From your example code, it looks like you need to understand classes/objects too. And, I assume you need know some Windows programming (another advanced topic).... I assume you need to make a GUI Window before doing anything with DirectX graphics.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  2. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 01:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM