Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,264 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,513 people online right now. Registration is fast and FREE... Join Now!




Classes in C++

 
Reply to this topicStart new topic

Classes in C++

Precious123
15 Oct, 2006 - 04:43 PM
Post #1

New D.I.C Head
*

Joined: 15 Oct, 2006
Posts: 1


My Contributions
In using aggregation with classes, this is my problem. I have a class that has a 2d vector and I want two other classes to gain access to that vector in the first class. How do I make an instance of the class with a vector in it in order for the other two classes to access the vector? Anything you can give me to help will be great. My project is due soon and I am so confused on this part. Thanks again.
User is offlineProfile CardPM
+Quote Post

Mrafcho001
RE: Classes In C++
15 Oct, 2006 - 04:57 PM
Post #2

D.I.C Addict
Group Icon

Joined: 1 Nov, 2005
Posts: 753



Thanked: 5 times
Dream Kudos: 120
My Contributions
3 options
- make vector public
- add a function(s) for interacting with the vector
- friend classes
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 07:19PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month