Thread: what does these mean

  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