Search:
Forum
General C++ Programming
test question
test question
Aug 11, 2009 at 6:51pm UTC
chrisben
(99)
Run into a question in a test recently, not quite sure what is the right answer? Any suggestion?
Thanks
What kind of variable do you use if you need to share a variable from one instance of a class to the next?
1 volatile
2 register
3 static
4 protected
5 auto
Aug 11, 2009 at 7:18pm UTC
Return 0
(1282)
This is an easy one. You should try and figure this out first.
Aug 11, 2009 at 7:22pm UTC
chrisben
(99)
i think only static make sense to have a single variable shared by the same type of classes. but the sentence of "from one instance of a class to the next" confuse me a little bit. not sure whether that is what it asks me.
thanks
Aug 11, 2009 at 7:41pm UTC
helios
(17607)
It's not very well redacted, but yes, the answer is 3.
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs