cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
How to call another constructor?
How to call another constructor?
Jul 30, 2012 at 1:24am UTC
beakie
(166)
How can I call a constructor from a constructor?
1
2
3
Txt::Txt(
int
i) {
this
->Txt(
""
); };
Jul 30, 2012 at 1:51am UTC
ResidentBiscuit
(4459)
You can't explicitly call a constructor, not sure what you're trying to do here, but it seems like poor design
Jul 30, 2012 at 8:59am UTC
Peter87
(11234)
In C++11 you can do it like this
Txt::Txt(
int
i) : Txt(
""
) {}
Last edited on
Jul 30, 2012 at 8:59am UTC
Topic archived. No new replies allowed.