It has various meanings depending on the context.
A virtual method in a base class implies the method may be overridden by a derived class, in which case calling that method on the base class calls the method in the most-derived class that implements that method. This is achieved via the virtual table (v-table), so there is no need to determine the actual type of the derived class at runtime.
A pure-virtual method in a base class implies the class is abstract and must be derived from, and that a derivative must implement the method (or it becomes abstract itself). You cannot instantiate abstract classes. They are intended purely to provide a common interface to their derivatives.
A virtual base class is a class that is common to two or more derived classes that may be combined in a multiple-inheritance class. If the derived classes declare the base class virtual, the derived classes will share the same instance of the base class, and the multiple-inheritance class will inherit just one instance of the base class from those derived classes. If the derived classes do not declare the base class virtual, the derived classes have separate instances of the base class, which inevitably leads to an ambiguity in the multiple-inheritance class.
A virtual function is a member function of a class, whose functionality can be over-ridden in its derived classes. It is one that is declared as virtual in the base class using the virtual keyword. The virtual nature is inherited in the subsequent derived classes and the virtual keyword need not be re-stated there. The whole function body can be replaced with a new set of implementation in the derived class
println is not a C++ keyword.
No. Keywords are reserved and cannot be used as identifiers. However, C/C++ is case-sensitive. So although register is a reserved keyword, Register is not.
The const keyword declares any named value to be a constant.
Virtual keyword in C++ is used to make a method virtual.In C++ Virtual method is is used to accomplish run time polymorphism. Virtual methods can be overridden in its derived classes. For example: class A { private: int x; public: virtual void abc() { } }; Class B : public A { private: int y; public: void abc() //abc is virtual here by default and can be overridden { } }; Regards, Rajneesh
Using TurboC? kbhit and getch are your friends
No extern keyword in Java.
To overload an operator. ie to write operator functions
An override is the specialisation of a virtual function. The new keyword instantiates an instance of an object in dynamic memory and returns a reference to that object (or null if the object could be instantiated). Both are used in C++, but not C.
The final keyword is used to prevent overriding virtual functions. It can be applied to a class as a whole, thus preventing the class from being used as a base class, or it can be applied to a virtual function override, thus preventing that function from being overridden. This can have a significant benefit in terms of performance because we can statically link to final methods rather than dynamically link to them via a virtual table, and thus provide greater opportunities for inline expansion.
The lazy way is to use a dynamic cast. The correct way is to use virtual functions in the base class. That way you don't ever need to know the derived type -- it simply does what is expected of it.
Objects are instantiated when statically declared or dynamically created with the new keyword.
It doesn't. Void has the same meaning in both.
Neither "in" nor "is" is a keyword in C.
In C++ NULL is defined as 0. It's a design failure, will be fixed with a new 'nullptr' keyword.
Public isn't a keyword in C. It's a keyword in C++ to state that members of a class are accessible from outside that class.
The keyword "friend" allows a function or variable to have access to a protected member inside a class.
#define is a preprocessor directive used to declare macros. typedef is a C++ keyword to define a data type.
There is no such keyword or data type known as tbuffer in C++. It's most likely an user-defined identifier, possibly a text buffer. But without knowing its actual type or its context it's impossible to say what it means.
'Keyword' is a synonym for 'reserved word', it is not specific to C language.
No. Main is not a keyword in C or C++. However, your program, when linked, must provide one and only one externally scoped entry point to main(). If you use main in some other context, and you do not provide one and only one entry point main(), then your program will not link nor run.
For example: int new; /* 'new' is a keyword in C++ */ char str[3] = "ABC"; /* Won't work in C++ */ void *p; char *s= p; /* requires explicit typecast */
No, it does not. But Microsoft Visual Studio 2008 allows you to connect to a virtual machine and run your projects "sandboxed".