Day 1:
- Compilation :
Find
the compilation steps from .c format to executable format.
Collect
the files which was generated in each steps
Analysis
the file and understand the purpose of each file.Day 2:
- What are all storage class is available in c, the scope (visibility) and life-time of variables and/or functions within a C Program.
- Difference between static function & normal function. With example programs.
Day 3:
- Memory Layout of C Programs ?
- Check the size of text, data, and bss segments of below programs.
- Check the following simple C program
#include <stdio.h>
int main(void)
{
return 0;
}
- Let us add one global variable in program, now check the size of bss (highlighted in red color)
#include <stdio.h>
int
global; /* Uninitialized variable stored in
bss*/
int main(void)
{
return 0;
}
- Let us add one static variable which is also stored in bss.
#include <stdio.h>
int
global; /* Uninitialized variable stored in
bss*/
int main(void)
{
static int i; /* Uninitialized
static variable stored in bss */
return 0;
}
- Let us initialize the static variable which will then be stored in Data Segment (DS)
int
global; /* Uninitialized variable stored in
bss*/
int main(void)
{
static int i = 100; /* Initialized
static variable stored in DS*/
return 0;
}
- Let us initialize the global variable which will then be stored in Data Segment (DS)
#include <stdio.h>
int global
= 10; /* initialized global variable stored
in DS*/
int main(void)
{
static int i = 100; /* Initialized
static variable stored in DS*/
return 0;
}
Day 4:
- Read below to understand the heap memory:
- What is heap memory?
- Difference between malloc(), calloc() & realloc()
- What is Memory Leak? How can we avoid?
- what is the difference between memory leak & memory wastage
- Why need to use free() ?
- what is heap corruption in c ?
No comments:
Post a Comment