A few questions on classes!..

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2006
Posts: 4
Reputation: Natrius is an unknown quantity at this point 
Solved Threads: 0
Natrius Natrius is offline Offline
Newbie Poster

Re: A few questions on classes!..

 
1
  #11
Sep 8th, 2006
Thanks for the help!
But it still doesn't work properly.. It complains that the variable 'counter' is a private variable.. And it doesn't work if I cange it into a public one.
Any clues why?

EDIT: I've also got another question if someone knows the answer..
I'm working on an assignment where you have to take an object of a class and have it as an membervariable of another class. How do I do this?
Last edited by Natrius; Sep 8th, 2006 at 4:56 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 1,496
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Solved Threads: 104
Moderator
WolfPack's Avatar
WolfPack WolfPack is offline Offline
Mentally Challenged Mod.

Re: A few questions on classes!..

 
1
  #12
Sep 8th, 2006
Originally Posted by Natrius View Post
Thanks for the help!
But it still doesn't work properly.. It complains that the variable 'counter' is a private variable.. And it doesn't work if I cange it into a public one.
Any clues why?
The answer to this is in the web link I gave you in my reply. Something about the static variable being initialized globally. See if you can find it.

Originally Posted by Natrius View Post
EDIT: I've also got another question if someone knows the answer..
I'm working on an assignment where you have to take an object of a class and have it as an membervariable of another class. How do I do this?
  1. class A
  2. {
  3. public:
  4. int a;
  5. };
  6.  
  7. class B
  8. {
  9. public:
  10. A member_var_of_instance_A;
  11. }
バルサミコ酢やっぱいらへんで
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC