what is difference between static and non-static variables

Answer Posted / udit rawat

static variable take memory first at linking and loading time
while non static variable take memory at compile time

Is This Answer Correct ?    35 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the rules about using an underscore in a c++ identifier?

634


What is implicit pointer in c++?

600


Can a new be used in place of old mallocq? If yes, why?

633


Explain the difference between new() and malloc() in c++?

622


Can we define function inside main in c++?

551






Which bitwise operator is used to check whether a particular bit is on or off?

585


Name the operators that cannot be overloaded in C++?

583


What are guid? Why does com need guids?

568


When do we use copy constructors?

593


Mention the storage classes in c++.

645


What is static class data?

573


What is the difference between the indirection operator and the address of oper-ator?

604


How do you initialize a string in c++?

558


How does a C++ structure differ from a C++ class?

620


What are shallow and deep copies?

629