100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
College aantekeningen

Computer system

Beoordeling
-
Verkocht
-
Pagina's
72
Geüpload op
24-07-2023
Geschreven in
2017/2018

Computer system, computer science, computer skills, computer language

Instelling
Vak











Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Study Level
Publisher
Subject
Course

Documentinformatie

Geüpload op
24 juli 2023
Aantal pagina's
72
Geschreven in
2017/2018
Type
College aantekeningen
Docent(en)
Prof
Bevat
Alle colleges

Onderwerpen

Voorbeeld van de inhoud

assumed as auto and stored in the memory. When a variable is declared as register, it is stored
in the CPU registers. The default value of the variable will be garbage value. Scope of the
variable within the block where it is defined and the life of the variables is until the control
remains within the block.

Register variable has faster access than normal variable. Frequently used variables are kept in
register. Only few variables can be placed inside register.

NOTE : We can't get the address of register variable

Sytax : register data_type variable_name;

Ex: register int i;

Ex : void demo(); OUTPUT

void main() 20

{ 20

demo(); 20

demo();

demo();

}

void demo()

{

register int i=20;

printf(“%d\n”,i);

i++;

}

3 : Static Storage class : When a variable is declared as static, it is stored in the memory. The
default value of the variable will be zero. Scope of the variable is within the block where it is
defined and the life of the variable persists between different function calls. To define a variable
as static storage class, the keyword „static‟ is used. A static variable can be initialized only
once, it cannot be reinitialized.

Syntax : static data_type variable_name;


C PROGRAMMING Page 161

, The variables a and b are declared as integer type and auto. The keyword auto is
not mandatory. Because the default storage class in C is auto.

Note: A variable declared inside a function without any storage class specification, is by default
an automatic variable. Automatic variables can also be called local variables because they
are local to a function.



Ex : void function1();

void function2(); OUTPUT

void main() 10

{ 0

int x=100; 100

function2();

printf(“%d”,x);

}

void function1()

{

int x=10;

printf(“%d”,x);

}

void function2()

{

int x=0;

function1();

printf(“%d”,x);

}

2: Register Storage class : To define a variable as register storage class, the keyword
„register‟ is used. If CPU cannot store the variables in CPU registers, then the variables are

C PROGRAMMING Page 160

,Storage Classes
In C language, each variable has a storage class which is used to define scope and life time of a
variable.

Storage: Any variable declared in a program can be stored either in memory or registers.
Registers are small amount of storage in CPU. The data stored in registers has fast access
compared to data stored in memory.

Storage class of a variable gives information about the location of the variable
in which it is stored, initial value of the variable, if storage class is not specified; scope of the
variable; life of the variable.



There are four storage classes in C programming.

1 : Automatic Storage class.

2 : Register Storage class.

3 : Static Storage class.

4 : External Storage class.

1: Automatic Storage class : To define a variable as automatic storage class, the keyword „auto‟
is used. By defining a variable as automatic storage class, it is stored in the memory. The default
value of the variable will be garbage value. Scope of the variable is within the block where it is
defined and the life of the variable is until the control remains within the block.

Syntax : auto data_type variable_name;

auto int a,b;

Example:

void main()

{

int detail;

or

auto int detail; //Both are same

}


C PROGRAMMING Page 159

, isalnum(c) Int Determine if argument is alphanumeric. Return nonzero value
if true, 0 otherwise.

isalpha(c) Int Determine if argument is alphabetic. Return nonzero value if
true, 0 otherwise.

isascii(c) Int Determine if argument is an ASCII character,. Return nonzero
value if true, 0 otherwise.

isdigit(c) Int Determine if argument is a decimal digit. Return nonzero
value if true, 0 otherwise.

isgraph(c) Int Determine if argument is a graphic printing ASCII Character.
Return nonzero value if true, 0 otherwise.

islower(c) Int Determine if argument is lowercase. Return nonzero value if
true, 0 otherwise.

isprint(c) Int Determine if argument is a printing ASCII character. Return
nonzero value if true, 0 otherwise.

isspace(c) Int Determine if argument is a whitespace character. Return
nonzero value if true, 0 otherwise.

isupper(c) Int Determine if argument is uppercase. Return nonzero value if
true, 0 otherwise.

toascii(c) Int Convert value of argument to ASCII

tolower(c) Int Convert letter to lowercase

toupper(c) Int Convert letter to uppercase.



6 : TIME LIBRARY FUNCTIONS <TIME.H>

Functions DataType Purpose

difftime(11,12) double Return the time difference 11-12, where 11 and 12
represent elapsed time beyond a designated base time.

time(p) long int Return the number of seconds elapsed beyond a designated
base time.




C PROGRAMMING Page 158
€13,07
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
akhilagouri

Maak kennis met de verkoper

Seller avatar
akhilagouri A Level Notes
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
0
Lid sinds
2 jaar
Aantal volgers
0
Documenten
107
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen