![]() |
| Home | Tech FAQ | Interview Questions | Placement Papers | Tech Articles | Learn | Freelance Projects | Online Testing | Geeks Talk | Job Postings | Knowledge Base | Site Search | Add/Ask Question |
![]() Related Questions Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also. Latest Answer : Similar to difference in default access specifier, default inheritance too is different in Class Vs Structures. ... A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually Latest Answer : A virtual function allows derived classes to replace the implementation provided by the base class. ... Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects. Ø A Class Latest Answer : Class is a combination of data member & member function where object is used for calling function In class we declare In object we call ... The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, Latest Answer : free() - releases the memory of the pointer passed as parameter, to the OS/application consumption. Using the pointer after free() will result in undefinded resultsrealloc() - used to resize the memory held by the pointer to the number of bytes specificed. ... Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill Latest Answer : template is used for creating generic functions as well as data members. ... Runtime type identification (RTTI) lets you find the dynamic type of an object when you have only a pointer or a reference to the base type. RTTI is the official way in standard C++ to discover the type Latest Answer : We can only assign a derived object to a base object pointer and a base class member to a derived class member pointer. ... Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching Latest Answer : Virtual constructor is not build-in C++ feature but it doesn't mean its not used by devs in code and in conversations. There are many other things that doesn't exist in particular language yet, people find ways around to solve it (SingleTon, Virtual Constructor, ... There is only one difference ,in classes the members are private by default whereas it is not so in structures. Latest Answer : Amid, you are talking about "C" structure that knows nothing about classes etc. The only difference between C++ class and struct is default access specifier (private and public respectively) ... Latest Answer : Operator new mean overloading the operator 'new', giving your own defintion for the existing 'new' operator. ... Read Answers (3) | Asked by : suman Latest Answer : C does not have limitation access. Structures in C are used to regroup data from different types.In C++ structure have limitation access propreties (private,public protected) with public access as default, can contain methods and can be used as a class. ...
Sponsored Links
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||