This is a discussion on calling functions nested in classes using objects from oder classes within the C and C++ forums, part of the Programming Talk category; Hello, I'm new in c++. In my program I've got 2 classes where I defined some functions. Then ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
calling functions nested in classes using objects from oder classes
Hello, I'm new in c++.
In my program I've got 2 classes where I defined some functions. Then I defined 2 vector-objects of each class and I tried to call one function from the main(): class class1{ variables1; int t; public int get_t(){return t;}; }; class class2{ variables2; int r; class2* c2; public: int get_r(){return r;}; void void2(class1* a, class2* b, int m ){ for(int i=0; i<m; i++){ if(a->get_r()< b[i]->get_t()){ // whatever, but I don't change anything;} } }; main(){ std::vector<class1*> element1; std::vector<class2*> element2; int n; //I initilize both vectors for(int i;i<n; i++){ element2[i]->void2(element2[i], element1); //How to call the function?? } } I tried everything and I red tutorials and nothing wrks. HELP!! THX, mario-kl. |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:00 AM |
| comp.cad.autocad AutoLISP FAQ (part 2/2) - samples, code | Reini Urban | Tech FAQ | 0 | 06-01-2004 06:30 AM |
| comp.cad.autocad AutoLISP FAQ (part 1/2) - general | Reini Urban | Tech FAQ | 0 | 06-01-2004 06:30 AM |
| Robot Competition FAQ for June 2004 | R. Steven Rainwater | Tech FAQ | 0 | 05-27-2004 09:59 PM |
| comp.cad.autocad AutoLISP FAQ (part 2/2) - samples, code | Reini Urban | Tech FAQ | 0 | 05-01-2004 06:30 AM |