{"id":2759,"date":"2024-06-22T14:53:18","date_gmt":"2024-06-22T14:53:18","guid":{"rendered":"https:\/\/odeacademy.in\/?p=2759"},"modified":"2024-06-22T14:53:18","modified_gmt":"2024-06-22T14:53:18","slug":"c-language-4-storage-classes-auto-extern-static-register","status":"publish","type":"post","link":"https:\/\/thequickknowledge.com\/exam\/c-language-4-storage-classes-auto-extern-static-register\/","title":{"rendered":"C language 4 storage classes : auto, extern, static, register"},"content":{"rendered":"<h5>In C language four storage classes, namely<\/h5>\n<h6 style=\"padding-left: 40px;\"><strong>1.<\/strong>\u00a0<strong>auto<\/strong><\/h6>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>This is the default storage class for all the variables. Auto variables can be only accessed within the block\/function.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h6 style=\"padding-left: 40px;\"><strong>2. <\/strong><strong>extern<\/strong><\/h6>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>the variable is defined elsewhere and not within the same block where it is used, this can be overwritten in a different block as well. So an extern variable is nothing but a global variable.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h6 style=\"padding-left: 40px;\"><strong>3. static<\/strong><\/h6>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>initialized only once and exist till the termination of the program, Their scope is local to the function to which they were defined.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h6 style=\"padding-left: 40px;\"><strong>4. register<\/strong><\/h6>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>declares same functionality as that of the auto variables, difference is that the compiler tries to store these variables in the register of the microprocessor.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In C language four storage classes, namely 1.\u00a0auto This is the default storage class for all the variables. Auto variables can be only accessed within the block\/function. 2. extern the variable is defined elsewhere and not within the same block where it is used, this can be overwritten in a different block as well. So [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[20,14],"class_list":["post-2759","post","type-post","status-publish","format-standard","hentry","category-new-post","tag-c-language","tag-computer-science"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/posts\/2759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/comments?post=2759"}],"version-history":[{"count":5,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/posts\/2759\/revisions"}],"predecessor-version":[{"id":2764,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/posts\/2759\/revisions\/2764"}],"wp:attachment":[{"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/media?parent=2759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/categories?post=2759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thequickknowledge.com\/exam\/wp-json\/wp\/v2\/tags?post=2759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}