|
-
June 3rd, 2009, 04:11 PM
#1
multiple instances of a class
Dear All,
I m trying to use a class that does not have a default constructor. For this class, i m unable to declare 2 instances.
eg:
option 1 (successful compilation)
MyClass obj1; // ok
option 2 (error)
MyClass obj1, obj2;
option 3 (error)
MyClass obj1;
MyClass obj2;
The error I get is: "no appropriate default constructor"
Is it the lack of default constructor or something else that prevents multiple instances? I remember in java there are mechanisms by which we can restrict the number of instances of a class; but i dont see anything special in the class that I m using.
Thanks for looking,
sgiri
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|