I wanted to know that where will the uninitialized data be stored after it has been modified?
For instance,
all the variables which are initialized to some value in the code will be stored in the .data section.
all the variables which are not initialized, will be initialized to 0 by the compiler and stored in the .bss section.
Now, let's say, I define an array of 10 integers in the code. But I do not specify the elements of this array. So, all the integers of the array will be initialized to 0 by the compiler and 40 bytes will be reserved in the .bss section.
After this, I write some data to the array, will it modify the data in .bss section itself?
#include <stdio.h>
#include <math.h>
int main(int argc, char **argv)
{
int i;
/* 10 integers are initialized to 0 and stored in the .bss section */
unsigned int numbers[10];
/* write data to array */
for(i=0;i<10;i++)
{
numbers[i]=pow(2,i);
}