not so obvious pointers

Posted by mike_hornbeck on Stack Overflow See other posts from Stack Overflow or by mike_hornbeck
Published on 2010-03-23T00:19:20Z Indexed on 2010/03/23 0:21 UTC
Read the original article Hit count: 691

Filed under:
|
|

I have a class :

class X{
 public :
 void f ( int ) ;
 int a ;
} ;

And the task is "Inside the code provide declarations for :

  • pointer to int variable of class X
  • pointer to function void(int) defined inside class X
  • pointer to double variable of class X"

Ok so pointer to int a will be just int *x = &a, right ? If there is no double in X can I already create pointer to double inside this class ? And the biggest problem is the second task. How one declares pointer to function ?

© Stack Overflow or respective owner

Related posts about c++

Related posts about pointers