Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Can a structure in C++ have a Constructor and Destructor within the C and C++ forums, part of the Software Development category; Can a structure in C++ have a constructor and a destructor....
|
|||||||
|
|||
|
Can a structure in C++ have a constructor and a destructor.
|
| The Following User Says Thank You to coolsomoo For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Can a structure in C++ have a Constructor and Destructor
yes , in c++ there is no difference between structure and class except in the protection for data inside them (default access in class is private and public in structure).
good luck, |
|
|||
|
Re: Can a structure in C++ have a Constructor and Destructor
yes off course. in C++ the structure has also default constructor and destructor. Because the structure is also a user defined data type but by default the members are public where as by default the members of class in c++ is private. only they are differ from each other on the basis of access specifiers. Nothing else....
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| constructor & destructor | Molugu Natraj | C and C++ | 6 | 05-10-2009 09:41 AM |
| constructor | emb.mallik | C and C++ | 1 | 03-02-2009 04:50 PM |
| Constructor | kranti_435 | Java | 1 | 09-01-2008 08:47 AM |
| Copy Constructor | manoj200724 | C and C++ | 7 | 06-15-2008 04:04 PM |
| why i am getting an error while calling a constructor from another constructor | raj_java_j2ee | Java | 4 | 07-22-2007 03:39 AM |