What is the best way to declare and define global variables?
Answer / Pawan Kumar Sahu
Global variables are declared outside of any function. For variable declaration, you can simply write `extern type variableName;`, but for initialization, use `extern type variableName = value;` in a .cpp file.
| Is This Answer Correct ? | 0 Yes | 0 No |
What do you mean by “this” pointer?
When volatile can be used?
Do class declarations end with a semicolon? Do class method definitions?
Write a program to get the value of sin (x) using a library function , when x is given in degrees.
Difference between overloaded functions and overridden functions
What are associate containers?
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
What is the difference between "calloc" and "malloc"?
int *p = NULL; printf("%1d",p) ; what will be the output of this above code?
How do I download c++?
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
What is expression parser in c++