Differentiate between declaration and definition in C++?
Answer / atul shankhwar
A declaration introduces a name into the program; a definition provides a unique description of an entity (e.g. type, instance, and function). Declarations can be repeated in a given scope, it introduces a name in a given scope. There must be exactly one definition of every object, function or class used in a C++ program.
A declaration is a definition unless:
it declares a function without specifying its body,
it contains an extern specifier and no initializer or function body,
it is the declaration of a static class data member without a class definition,
it is a class name definition,
it is a typedef declaration.
A definition is a declaration unless:
it defines a static class data member,
it defines a non-inline member function.
| Is This Answer Correct ? | 0 Yes | 0 No |
which is the easy way to divide any integer by 2?
Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort
Explain the properties and principles of oop.
What are the three forms of cin.get() and what are their differences?
What are the total number of lines written by you in C/C++? What is the most complicated or valuable program written in C/C++?
describe private access specifiers?
Why should you learn c++?
What is c++ in english?
Do inline functions improve performance?
1. What does the following do: void afunction(int *x) { x=new int; *x=12; } int main() { int v=10; afunction(&v); cout<<v; } a) Outputs 12 b) Outputs 10 c) Outputs the address of v
What is lambda in c++?
What is the difference between containment and delegation?