erroneus statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agsupriya86
    New Member
    • Mar 2007
    • 34

    erroneus statement

    which is the erroneous statement among following??



    Int *p[3]

    Int (*p)[3]

    (Int *)(int ,int)

    Int (*p[3])

    Int *(p[3])
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This looks like a class assignment.

    So, write down what you think each statement means and send me your statements. I'm guessing that the erroneous statement will identify itself when you cannot write down what it means.

    Comment

    • agsupriya86
      New Member
      • Mar 2007
      • 34

      #3
      Originally posted by agsupriya86
      which is the erroneous statement among following??



      Int *p[3]

      Int (*p)[3]

      (Int *)(int ,int)

      Int (*p[3])

      Int *(p[3])
      i guess the first one is an array of pointers..

      second one is pointer to an array..

      third one is a function returning a pointer to an int and having two ints as an arguments..

      fourth one is again an array of pointers..

      5th one is a pointer to an array..but am not sure abt it..please verify me ..

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        OK, here you go:

        Int *p[3] //p is an array of 3 pointers-to-int

        Int (*p)[3] //p is a pointer to an array of 3 int

        (Int *)(int ,int) //garbage

        Int (*p[3]) //p is an array of 3 pointers-to-int

        Int *(p[3]) //p is an array of 3 pointers-to-int

        Comment

        Working...