what is difference between static and non-static variables
Answer Posted / achal ubbott
The above answers are correct. A local static variable is
stored in heap. But a local variable is stored onto stack.
A Global variable made static can't be accessed from a
function outside the file using extern. So it limits the
scope.
| Is This Answer Correct ? | 2 Yes | 10 No |
Post New Answer View All Answers
What is searching? Explain linear and binary search.
Explain how to initialize a const data member.
What is flag in computer?
Explain static and dynamic memory allocation with an example each.
What is the difference between function overloading and operator overloading?
Write my own zero-argument manipulator that should work same as hex?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
Show the declaration for a static member variable.
What is a class template?
Difference between class and structure.
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
What is the difference between structure and class?
What are exceptions c++?
How delete [] is different from delete?
Define a nested class. Explain how it can be useful.