Quick pointer question

This is a discussion on Quick pointer question within the C Programming forums, part of the General Programming Boards category; What's the difference between: *pointer[10] and (*pointer)[10] and *(pointer[10]) ? Thanks....

  1. #1
    Banned
    Join Date
    Mar 2008
    Posts
    78

    Quick pointer question

    What's the difference between:

    *pointer[10]

    and

    (*pointer)[10]

    and *(pointer[10]) ?

    Thanks.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,883
    *pointer[10] is equivalent to *(pointer[10]), which means "dereference pointer[10]" or "get the object pointed to by pointer[10]". (*pointer)[10] on the other hand, means "gets the 11th element of the array pointed to by pointer".
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 04-04-2009, 03:45 AM
  2. Quick Pointer question
    By Sentral in forum C++ Programming
    Replies: 3
    Last Post: 05-14-2006, 07:36 PM
  3. Simple pointer question
    By jayznz in forum C Programming
    Replies: 2
    Last Post: 04-04-2006, 11:36 PM
  4. Declaring a Pointer (quick question)
    By viciousv322 in forum C Programming
    Replies: 4
    Last Post: 12-16-2005, 10:27 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM

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