Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 07-11-2009
Member
 
Join Date: Sep 2009
Posts: 177
Meaning of storage class specifiers in C++ Language

Hello everybody. I am learning C++ programming language. I have been using this programming language for last 2 months. Now I am confused with this stuff called as Storage Class Specifiers. I want a description of Storage Class Specifiers. Please educate me on this topic. Help me with this. I am not understanding it.
Reply With Quote
  #2  
Old 07-11-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: Meaning of storage class specifiers in C++ Language

We can easily refine the declaration for a variable, parameters and functions. A storage class specifier helps us to do this task. The following are the Storage class specifiers in C++: Auto, Register, Static and Extern. Also the keyword "mutable" may also be considered a Storage class specifier. But, it is only available in the member list of a class definition.
Reply With Quote
  #3  
Old 07-11-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Meaning of storage class specifiers in C++ Language

I was also facing the same problem when I had started learning C++. To put it in simple words, there four keywords in C++: static, extern , auto and register which are called Storage Class Modifiers. The scope of a variables is the location or the part within which the variable is accessible or visible. With the use of Storage class modifiers we can modify the storage location of a variable and thereby affect its scope and lifetime.
Reply With Quote
  #4  
Old 07-11-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Meaning of storage class specifiers in C++ Language

Brief description of four storage class specifiers:

The auto storage class specifier lets you explicitly declare a variable with automatic storage. The auto storage class is the default for variables declared inside a block. A function with external linkage can be called from other translation units. If a function is declared using extern keyword it is said to have external linkage. An internal linkage restricts the call to a function only with its translation unit. If a function is declared using static keyword it is said to have internal linkage. The register storage class specifier indicates to the compiler that the object should be stored in a machine register.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Meaning of storage class specifiers in C++ Language"
Thread Thread Starter Forum Replies Last Post
External Storage Class in C Agustíne Software Development 3 23-01-2010 11:51 AM
What are the Static storage class in C Garett Software Development 3 23-01-2010 11:07 AM
Register Storage class in C Gaauge Software Development 3 23-01-2010 10:06 AM
Automatic storage class in C Tailor Software Development 3 23-01-2010 09:07 AM
Java Programming Language Basics: Reflection Basics and Class Class mayuri_gunjan Guides & Tutorials 6 29-08-2005 12:04 AM


All times are GMT +5.5. The time now is 02:37 PM.