what does these mean

This is a discussion on what does these mean within the C++ Programming forums, part of the General Programming Boards category; hello guys, please explain me the following in detail. what does these mean, int(*p)[10] int*f() int(*pf)() int*p[10] bye srinu with ...

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    17

    Cool what does these mean

    hello guys,
    please explain me the following in detail.

    what does these mean,

    int(*p)[10]
    int*f()
    int(*pf)()
    int*p[10]

    bye
    srinu
    with regards
    srinu

  2. #2
    Registered User Strider's Avatar
    Join Date
    Aug 2001
    Posts
    149
    Code:
    // pointer to an array of ints
    int(*p)[10] 
    
    // function that takes no parameters and returns a pointer to an int
    int*f()
    
    // pointer to a function that takes no parameters and returns an int      
    int(*pf)() 
    
    // an array of int pointers
    int*p[10]
    The parentheses make a difference because * has a lower precedence than the parentheses.

    David
    One Ring to rule them all, One Ring to find them,
    One Ring to bring them all and in the darkness bind them
    In the Land of Mordor where the Shadows lie.

Popular pages Recent additions subscribe to a feed

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