Hİ everybody,

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crazyapple
    New Member
    • Apr 2007
    • 2

    Hİ everybody,

    what is the difference between int *a[20] and int (*a)[20]???????
  • Extremist
    New Member
    • Jan 2007
    • 94

    #2
    Originally posted by crazyapple
    what is the difference between int *a[20] and int (*a)[20]???????
    Hi there

    int *a[20] would mean a pointer to an array of 20 ints

    int (*a)[20] would mean an array of 20 pointers to ints

    Comment

    • crazyapple
      New Member
      • Apr 2007
      • 2

      #3
      Originally posted by Extremist
      Hi there

      int *a[20] would mean a pointer to an array of 20 ints

      int (*a)[20] would mean an array of 20 pointers to ints

      thank you very muchh

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        This is not true:
        Originally posted by Extremist
        int *a[20] would mean a pointer to an array of 20 ints

        int (*a)[20] would mean an array of 20 pointers to ints
        The correct meaning is:

        int *a[20]; -> a is an array of 20 pointers to int
        int (*a)[20]; -> a is a pointer to an array of 20 ints

        Comment

        Working...