Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

0_between_1_and_2

Is this possible ?

This topic is 6935 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

class A; class B; class A { int test; }; class B { void testh(int hehe); A *tester; }; void B::testh(int hehe) { tester->test = hehe; } Is this possible ? and how do i have to inizialize the pointer ? I think its possible, so could you please write a sampe main() function for that showing how i have to use the pointer ? cYa I am the Null between One and Two Edited by - 0_between_1_and_2 on 4/22/00 3:11:21 PM

Share this post


Link to post
Share on other sites
Advertisement
You''ll have to do what "ga" said (to use a constructor and destructor), or else don''t use a pointer but rather an instance.

Also "test" is private in class A, so

void B::testh(int hehe)
{
tester->test = hehe;
}

won''t work in the first place, so you need an public access function in class A.

aig

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!