Original Post
Pretend I have a simple class which includes the following function:
I then declare the class in main and go through each object.
What do I replace the question marks with to make the program print the index of the specifc object being addressed? Is this possible? I wasn't able to find the answer after several searches on Google.
int object::getIndex()
{
return ??????????;
}
I then declare the class in main and go through each object.
object myobjects[50];
for (int i = 0; i <50; i++)
cout << "Object index: " << myobjects.getindex();
What do I replace the question marks with to make the program print the index of the specifc object being addressed? Is this possible? I wasn't able to find the answer after several searches on Google.