#include <stdio.h>
static int test;
int main () {
return 0;
}
and after i compiled the file and check the size of bss segment nothing changed.
here’s the ouput of the terminal after i check the bss segment size before adding the uninitialized static variable
C:UsersUserDocumentsProgrammingC>size a.exe
text data bss dec hex filename
14584 2556 480 17620 44d4 a.exe
here’s the ouput after i compiled with the uninitialized static var.
C:UsersUserDocumentsProgrammingC>gcc test_static.c
C:UsersUserDocumentsProgrammingC>size a.exe
text data bss dec hex filename
14584 2556 480 17620 44d4 a.exe
ps. please teach me and correct my mistakes. im trying to learn c and i also want to learn what is happening behind the scene of the computer that is why im doing this…
i tried checking the data segment when i compiled the file with initialized static variable and it is adding up to the data segment which is working, but still the uninitialized static variable is not adding up to the bss
Rex jericho Tomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
that’s sad 🙁 help this poor guys plsplspls
Insanity Gaming is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.