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


Please Help Members By Posting Answers For Below Questions

What is the use of volatile variable?

609


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

627


Mention the storage classes in c++.

661


What do c++ programmers do?

564


What are c++ templates used for?

627






What is problem with overriding functions?

613


What are the new features that iso/ansi c++ has added to original c++ specifications?

592


What's the order in which the local objects are destructed?

848


What is endianness?

635


What is the difference between a pointer and a link in c ++?

572


What do you mean by translation unit in c++?

689


What is linked list in c++?

700


Describe protected access specifiers?

687


What is lambda in c++?

584


Can we use struct in c++?

606