grrrrrrrr....my bad...ok heres an example code ..i am not attempting to call main() as brewbuck guessed..my bad if the post is confusing..infact I am in elementary school as brewbuck guessed right yet again..
Code:
#include<iostream>
#include<list>
using namespace std;
class RandomClass
{
private:
int xyz;
public:
void Make_A_List(RandomClass *);
};
int main()
{
RandomClass temp;
temp.Make_A_List(&temp);
return 0;
}
void RandomClass::Make_A_List(RandomClass *p)
{
list<RandomClass> ListOfInts;
list<RandomClass>::iterator it;
int input;
cout << "Enter the integer : "<< endl;
cin >>input;
p->xyz=input;
ListOfInts.push_back(*p);
for(it= ListOfInts.begin();it!=ListOfInts.end();it++)
cout<<it->xyz<<endl;
}
now what if i want to add another line at the end of Make_A_List function...
Code:
return it ; // "it" is the iterator
in that case i need to get rid of the void preceding the function prototype...but what takes the place of void then....that is my question.