Does a Function have any Storage Class in C Language?

Question: Does a function have any storage class in C Language? In what type of memory does the program code store?

Answer: Functions do not have any storage class. Actually, storage class is not an issue for the functions because Program Code is stored in the static memory. At run time, executable image (an ELF image on Linux) is loaded into the the physical memory area called the Process Address Space. Process Address Space comprises of three Segments viz. Text Segment, Stack Segment and Data Segment.

Program code is stored in the Text Segment, automatic/local variables, function’s return addresses etc. in the Stack Segment and Data, initialized and uninitialized in the Data Segment.

Sanfoundry Global Education & Learning Series – 1000 C Tutorials.

If you wish to look at all C Tutorials, go to C Tutorials.

If you find any mistake above, kindly email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.