-
creating objects
i am giving the option to create any no of class "Data" objects.so how can i do that since i will be asking him one by one not at once like i will not ask him to enter the number of objects to make. rather i will be asking like do you want another object to be created?
-
Forgive me if I am totally misunderstanding. I think you want a vector.
Example
Code:
#include <vector>
using std::vector;
int main(void) {
vector <my_object> array;
// put code here
return 0;
}
-
You should be more specefic, I cann't understand your question too.
-
Code:
#define MAX_OBJECTS 200
Object* MyObjects[MAX_OBJECTS];
int i = 0;
while( Answer == YES ) //Use an appropriate loop condition
{
MyObjects[i++] = new Object;
}
After the loop, i will be the number of objects that have been created.