100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Notas de lectura

Computer system

Puntuación
-
Vendido
-
Páginas
72
Subido en
24-07-2023
Escrito en
2017/2018

Computer system, computer science, computer skills, computer language

Institución
Grado











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Nivel de Estudio
Editores
Tema
Curso

Información del documento

Subido en
24 de julio de 2023
Número de páginas
72
Escrito en
2017/2018
Tipo
Notas de lectura
Profesor(es)
Prof
Contiene
Todas las clases

Temas

Vista previa del contenido

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
$15.62
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
akhilagouri

Conoce al vendedor

Seller avatar
akhilagouri A Level Notes
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
0
Miembro desde
2 año
Número de seguidores
0
Documentos
107
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes