UrbanPro
true

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Variables and Storage Classes

Darpan Kumar
18/05/2017 0 0

Variables and Storage Classes 

auto

  • default variable type
  • local to a function 

static

  • retains the values between function calls
  • initialized only once
  • unavailable outside the scope of the function 

extern

  • extern keyword tells the compiler that a variable (or function) exists, even if the compiler has not seen it in the file currently being compiled
  • forces external linkage 

volatile

  • volatile keyword prevents the compiler from performing any optimization based on the stability of that variable
  • value of a volatile variable is always read whenever its value is required 

register

  • variables are accessed faster
  • often placed in register
  • address of a register variable cannot be taken or computed i.e. the unary address-of operator (&) cannot be used with register arrays
  • register keyword cannot be used with arrays
0 Dislike
Follow 0

Please Enter a comment

Submit

Other Lessons for You

Contents Of C++ Programming
1. History of CPP 2. Concepts of OOP's 3. Introduction and Features of CPP (OOP's) 4. Characteristics of OOP's 5. CPP Keywords 6. Major Components of CPP: Encapsulation Inheritance Polymorphism 7....

Necessity of Theory and Practical in Computer Science.
Upon studying a subject both theory and practical are important. Usually many schools concentrate more on theory and the marks not on the practical. Other and opposite kind of people prefer practical...

Set 0 To Kth Bit In A Variable
The following code snippet Set 0 to Kth Bit in an variable #include int UnsetBitValue(int n, int k);int main(){ printf("%d\n\n",UnsetBitValue(255,6)); return 0;}// Set kth bit to zeroint UnsetBitValue(int...

Definite book guides for C++
This post attempts to collect the few pearls among the dozens of bad C++ books. Unlike many other programming languages, which are often picked up on the go from tutorials found on the internet, only...

What is Abstraction?
In theortical terms, abstraction is: Hiding details from the outer world. Providing only essential details to outer world. C++ provide ways to hide details using access specifiers: public, protected...
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more