what is difference between static and non-static variables

Answer Posted / narender vadhava

static variables have their fix values within a program but
in case of non-static variables their values are changable
within the same program.
syntax of static variable:-
static int s;
while
non static variables declared only by using general basic
data type.
as:-
int s;

Is This Answer Correct ?    14 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does a derived class inherit or doesn't inherit?

834


Define namespace in c++?

842


Why is main function important?

836


Why is "using namespace std;" considered bad practice?

861


What is a local reference?

920


Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.

877


Which operator cannot overload?

814


How should runtime errors be handled in c++?

851


What is endl?

902


Describe protected access specifiers?

911


What is an undefined behavior and sequence points

751


What is the use of object in c++?

823


What is the meaning of string in c++?

799


What are the benefits of operator overloading?

902


What do nonglobal variables default to a) auto b) register c) static

911