APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY Previous Years Question Paper & Answer

Course : B.Tech

Semester : S1 and S2

Year : 2017

Term : DECEMBER

Branch : BIOTECHNOLOGY

Scheme : 2015 Full Time

Course Code : CS 100

Page:45





PDF Text (Beta):

else

printf("argument list is empty.\n");
} getch();

Return (0);

Remember that argv[0] holds the name of the program and 8೯8೫11] points to the
first command line argument and argv[n] gives the last argument. If no argument
is supplied, arge will be one.

9 a) Discuss storage classes with the help of examples. Scope rules

Storage classes.

Storage class in C decides the part of storage to allocate memory for a
variable, it also determines the scope of a variable. All variables defined in a
C program get some physical location in memory where variable's value is
stored. Memory and CPU registers are types of memory locations where a
variable's value can be stored. The storage class of a variable in C
determines the life time of the variable if this 15 'global' or ‘local’. Along with
the life time of a variable, storage class also determines variable's storage
location (memory or registers), the scope (visibility level) of the variable,
and the initial value of the variable. There are four storage classes in C those
are automatic, register, static, and external.

Storage Class Specifiers

There are four storage class specifiers in C as follows, typedef specifier
does not reserve storage and is called a storage class specifier only for
syntactic convenience. It is not a storage class specifier in the common
meaning.

உ auto
٠ register
٠ extern
٠ static
> typedef
These specifiers tell the compiler how to store the subsequent variable. The

general form of a variable declaration that uses a storage class is shown
here: storage_class_specifier data_type variable_name;

At most one storage class specifier may be given in a declaration. If no
storage class specifier is specified then following rules are used:

1. Variables declared inside a function are taken to be auto.
2. Functions declared within a function are taken to be extern.

Similar Question Papers