Hello people!
I have a quick question.
Let's assume you have a class which constructor takes an argument
Now let's say you want to dynamically allocate an object of the Foo class.
Foo* fooObject;
What is the correct syntax to create the object with the necessary arguments for the constructor?
1 2 3
|
int argument;
fooObject = new Foo(argument); //?
|
Thanks in advance,
Regards,
Hoogo.
Last edited on
Oh thank you for the reference, that helped. I wasn't able then, to test it so I thought I might ask directly the question out of curiosity.
Turns out this was indeed the right syntax!
Thanks for your time!