u wrong, if the constructor is private, new can't create its instance.

blaise (blaise)
constructor be private is meanful, friend function/class can create it. that's the way to avoid others(ur lib user) create the instance of class which you think they shouldn't do so.
(#119686@0)
2001-7-4 -05:00

回到话题: Can I write constructer as private in c++, if I can who can access it ? (This my interview question, continue)

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=119686