473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

default storage class specifier of a variable


I know java,but I am just beginner in C.I have some confusions
regarding extern storage specifier and default storage class specifier
for a variable when it has file scope that is ,when it is not
defined within
any block

--
Posted via http://dbforums.com
Nov 13 '05 #1
1 2486
On Sat, 05 Jul 2003 06:05:07 +0000, ravi_shankar
<me*********@dbforums.com> wrote in comp.lang.c:

I know java,but I am just beginner in C.I have some confusions
regarding extern storage specifier and default storage class specifier
for a variable when it has file scope that is ,when it is not
defined within
any block


The "extern" keyword is not a storage specifier, although it has some
restrictions as to the storage duration of the objects with which it
can be used. The "extern" keyword specifies that an object or
function has external linkage, which means that it can be referred to
by name from translation units other than the one it was defined in.

As to storage duration, all objects defined at file scope have static
storage duration. They also have external linkage unless defined
specifically with the keyword "static", which gives them internal
linkage.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ravi_shankar | last post by:
hi all. what's the advantage of prefixing a varible with "extern" storage class specifier other than its default initializion . you can mail to me : ravi_shankarprasad@rediffmail.com --...
14
by: aruna | last post by:
What is the disadvantage of using register storage class specifier?
2
by: sarathy | last post by:
Hi, What is the difference b/w a "storage class" and "storage class specifier"? It is said that there, Storage Class --automatic static ( K&R ) Storage Class Specifier --auto extern register...
1
by: sunny | last post by:
Hi C Ref Man says " The typedef specifier does not reserve storage and is called a storage class specifier only for syntactic convenience " does this mean storage specifier for "user...
4
by: Jess | last post by:
Hello, I tried several books to find out the details of object initialization. Unfortunately, I'm still confused by two specific concepts, namely default-initialization and...
1
by: martinezfive | last post by:
Hi, According to ISO C++ (7.11/2), "An object declared without a storage-class-specifier at block scope or declared as a function parameter has automatic storage duration by default." What about...
11
by: eBob.com | last post by:
I have this nasty problem with Shared methods and what I think of as "global storage" - i.e. storage declared outside of any subroutines or functions. In the simple example below this "global"...
5
by: kanalkannan | last post by:
Hi, I have heard a question in C data storage i want to know where the auto,static and global variables are get stored and what are the memory segments like stack heap and its allocation. ...
6
by: Sourabh Daptardar | last post by:
Why is register storage specifier not allowed for class member variables? <snip> ISO standard : Section 9.2 ; point 6 : -6- A member shall not be auto, extern, or register. </snip> I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.