I want to make it so a user of my Record creating program can create their own records. what is the best way to tackle this?
can i use an array or vector for the variable name?
int RecU[100];
class Record
{...};
int main()
{
Record RecU[1];
}
i tried it, and my program is crashing, so im not sure if it is possible.
If you want client code to be able to instantiate
Recordat will, all you have to do is ensure that at least one constructor is available to them (or a factory method). Normally this is the case. If you declare your class like this:…then there’s nothing to prevent client code from instantiating it. They can simply do this:
In your OP, it looked like you were trying to create an array of 100
Records. You do that like this: