As we discussed earlier, a variable is a name, given to a memory location, and it must be declared before it is used. In C, all the variables are declared at the starting of the program. In C++, variables can be declared, at any point of time, before they are used in the instructions. Variables are classified into ‘local’ and ‘global’ variable, which is the main topic of our discussion. Here the main difference between local and global variable is that a local variable is declared inside a … [Read more...]
Difference Between Identifier and Variable
The word ‘identifier’ clearly defines itself; an identifier is a name given to an entity, which distinctly identifies an entity in a program at the time of its execution. Variable is also an identifier; its name uniquely identifies itself in a program. Here, the fundamental difference between an identifier and variable is that an identifier is a “name given to entity” in a program whereas, a variable is a “name given to memory location”, that is used to hold value, which may get modified … [Read more...]
Difference Between Keyword and Identifier
Every language has keywords and identifiers, which are only understood by its compiler. Keywords are predefined reserved words, which possess special meaning. Each keyword defines the “type” declared data. Keywords should not be used as identifiers. An identifier is a unique name given to a particular variable, function or label of class in the program. To create a variable, both a keyword and an identifier are bind together. The identifiers can be altered if required, while this is not the … [Read more...]
Difference Between Function Overloading and Overriding in C++
Overloading and Overriding are the concepts of Polymorphism. In 'overloading' we redefine a function of a class with the same name but with, different numbers and types of parameters. In the 'overriding' prototype the overridden function is the same throughout the program but, the function to be overridden is preceded by the keyword 'virtual' in the base class and is redefined by the derived class without any keyword. Polymorphism is one of the crucial features of OOP. It simply means … [Read more...]
Difference Between Constructor and Destructor
Constructor and destructor are the member functions with the same name as their class. The former type constructor helps in initializing an object. Conversely, a destructor is different from the constructor which deletes the created constructor when it is of no use. Sometimes it is required to initialize some part of an object before it can be utilized. For example, we are operating on the stack, before we perform any action, the top of the stack must always be set to zero. This feature of … [Read more...]
Difference Between OOP and POP
Procedure-oriented Programming(POP) and Object-oriented programming(OOP) both are the programming approaches, which uses high-level language for programming. A program can be written in both the languages, but if the task is highly complex, OOP operates well as compared to POP. In POP, the ‘data security’ is at risk as data freely moves in the program, as well as, ‘code reusability’ is not achieved which makes the programming lengthy, and hard to understand. Large programs lead to more bugs, … [Read more...]
Difference Between Single and Multiple Inheritance
Inheritance is a method which can derive or construct new classes from the existing class. Here our main topic of discussion is the difference between single inheritance and multiple inheritance, two types of inheritance. In single inheritance, we do have only one base class, which is inherited by only one derived class. In multiple inheritance we have more than two base class which are combinely inherited by only one derived class. Inheritance strongly supports the concept of reusability, … [Read more...]
- « Previous Page
- 1
- …
- 10
- 11
- 12