|
-
July 1st, 2009, 04:15 AM
#1
Does this call create a list automatically?
Hello. Could anybody please clarify?
I came across a file called GGen.cpp. Inside it, there is a statement:
int i,j,nos = GetNumOfSteps();
I guess only nos is initialized to a value returned from GetNumOfSteps().
In GGen.h, things are defined as follows:
int GetNumOfSteps(void) const {
return CListManager<CStep>::GetNumOfItems();
}
Then, inside the file ListManager.h, I found:
private: list <T*> items;
public: virtual int GetNumOfItems(void) const { return items.size(); }
I guess the first line creates a private list named "items" of type CStep and
the second line gets the number of elements in this list. Am I Right?
When nos=GetNumOfSteps() is executed, the size of WHAT is going
to be returned? Does this call creates a list implicitly? As GGen.cpp
and ListManager.h are different files, I don't think this statement returns
the number of elements in the list "items". I am confused.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|