cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
How do I call?
How do I call?
Apr 26, 2012 at 2:09am UTC
bond5611
(47)
How do I call the parametrized constructor while creating pointer objects?
Apr 26, 2012 at 5:43am UTC
Zhuge
(4664)
You mean like this?
object* obj =
new
object(
/*...*/
);
Apr 26, 2012 at 6:06am UTC
incognito
(68)
Simply pass the arguments like Zhuge said. Note the difference between
class* obj = new class
[]
(To allocate memory for more than one elements) and class* obj = new class
(....)
(to pass values to 1 or more argument constructor)
Topic archived. No new replies allowed.