

{"id":123273,"date":"2024-02-07T18:00:41","date_gmt":"2024-02-07T12:30:41","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=123273"},"modified":"2024-02-07T18:58:40","modified_gmt":"2024-02-07T13:28:40","slug":"variable-scope-in-c-local-vs-global","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/","title":{"rendered":"Variable Scope in C \u2013 Local vs Global"},"content":{"rendered":"<p>Variables play a pivotal role in any programming language. They allow developers to store data during program execution for later use. However, not all variables behave the same &#8211; their accessibility within a program depends on their scope. The two primary types of variable scope in C programming are local and global.<\/p>\n<p>This article will provide an in-depth look at local and global variables, their key differences, advantages, disadvantages, and best practices for utilization in C code.<\/p>\n<h2>What is a Variable in C?<\/h2>\n<p>A variable can be defined as a named storage location that contains a data value that can change during program execution. Before being utilised, variables must be declared. Declaring a variable in C requires stating its type and name, <strong>for example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int x; \/\/declares an integer variable called x\r\nfloat y; \/\/declares a float variable called y\r\n<\/pre>\n<p>Here, int and float are data types, and x and y are the unique names given to the variables. The purpose of variables is to store program data that can be changed and manipulated as required by the program logic. Variables provide an abstraction for memory locations, allowing developers to use meaningful names instead of memory addresses.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/variable-Local-vs-Global-1.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-130494 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/variable-Local-vs-Global-1.webp\" alt=\"variable Local vs Global\" width=\"400\" height=\"210\" \/><\/a><\/p>\n<h3>Local Variables vs Global Variables in C<\/h3>\n<p>The scope of a variable defines where it is accessible within a program. Local and global variables differ significantly in their scope properties.<\/p>\n<h4>Local Variables in C<\/h4>\n<p>In C, local variables are defined within a function or block. They are only accessible within the { } braces of that function or block. Once the function or block finishes execution, local variables are destroyed, and memory is freed.<\/p>\n<p><strong>Consider the following example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void func() {\r\n  int x = 5; \/\/ x is a local variable\r\n  \r\n  printf(\"%d\", x); \r\n}<\/pre>\n<p>Here, x is a local variable limited to the func() function. If another function tries to access x, a compile error will occur since x only exists within func().<\/p>\n<h4>Key properties of local variables:<\/h4>\n<ul>\n<li>Exist only within the function or block they are declared in<\/li>\n<li>Not accessible outside their declaring function\/block<\/li>\n<li>Have automatic storage duration &#8211; created and destroyed automatically<\/li>\n<li>Uninitialized local variables contain garbage values<\/li>\n<\/ul>\n<h4>Global Variables in C<\/h4>\n<p>Global variables are declared outside of functions, usually on top of the file. They have a global scope and are accessible throughout the program after declaration.<\/p>\n<p><strong>For example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int y = 10; \/\/ y is a global variable  \r\n\r\nvoid func() {\r\n  printf(\"%d\", y); \/\/ y can be accessed here\r\n}<\/pre>\n<p>In this case, y is declared globally and can be used inside func() since it has a global scope.<\/p>\n<h4>Key properties of global variables:<\/h4>\n<ul>\n<li>Declared outside functions and blocks<\/li>\n<li>Accessible from anywhere in the program<\/li>\n<li>Have static storage duration &#8211; persist throughout the program<\/li>\n<li>Automatically initialized to 0 if unspecified<\/li>\n<\/ul>\n<h3>Scope of Variables in C<\/h3>\n<p>The scope of a variable in a program defines where and for how long that variable is valid and accessible. In essence, it sets the boundaries within which the variable can be utilized.<\/p>\n<p><strong>Variables have their scope determined at the time of declaration and can be categorized into two primary types:<\/strong><\/p>\n<ul>\n<li><strong>Global Variables:<\/strong> These variables are declared outside of any specific functions, making them accessible throughout the entire program.<\/li>\n<li><strong>Local Variables:<\/strong> These variables are declared within the confines of a specific function block, limiting their visibility and usability to that particular function.<\/li>\n<\/ul>\n<h3>Advantages and Disadvantages of C Local and Global Variables<\/h3>\n<p><strong>Both local and global variables have certain advantages and disadvantages:<\/strong><\/p>\n<h4>Advantages of Global Variables<\/h4>\n<ul>\n<li>Accessible from anywhere in the program<\/li>\n<li>Only a single declaration is needed<\/li>\n<li>Useful for sharing data across the entire program<\/li>\n<\/ul>\n<h4>Disadvantages of Global Variables<\/h4>\n<ul>\n<li>Risk of unintended side effects if modified incorrectly<\/li>\n<li>Namespace pollution when using many globals<\/li>\n<li>Poor encapsulation &#8211; hard to track all dependencies<\/li>\n<\/ul>\n<h4>Advantages of Local Variables<\/h4>\n<ul>\n<li>Limited scope avoids unintended access<\/li>\n<li>Enables name reuse across functions<\/li>\n<li>More efficient memory utilization<\/li>\n<\/ul>\n<h4>Disadvantages of Local Variables<\/h4>\n<ul>\n<li>Not usable across the entire program<\/li>\n<li>Scope limited to declaring function\/block<\/li>\n<li>No access to function parameters<\/li>\n<\/ul>\n<p>Generally, local variables are preferred for most use cases since they promote encapsulation and information hiding. However, global variables have their place for sharing state when needed.<\/p>\n<h3>Comparison Chart: Global vs. Local Variables in C<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>Feature<\/b><\/td>\n<td><b>Global Variable<\/b><\/td>\n<td><b>Local Variable<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Declaration<\/span><\/td>\n<td><span style=\"font-weight: 400\">Declared outside all functions, usually at the top of the code<\/span><\/td>\n<td><span style=\"font-weight: 400\">Declared within a function<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Scope<\/span><\/td>\n<td><span style=\"font-weight: 400\">Accessible by all functions in the program<\/span><\/td>\n<td><span style=\"font-weight: 400\">Accessible only within the function it is declared in<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Lifetime<\/span><\/td>\n<td><span style=\"font-weight: 400\">Exists for entire duration of program execution<\/span><\/td>\n<td><span style=\"font-weight: 400\">Created when function is called, destroyed when function exits<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Accessibility<\/span><\/td>\n<td><span style=\"font-weight: 400\">Can be accessed by any function in the program<\/span><\/td>\n<td><span style=\"font-weight: 400\">Can only be accessed within the function it is declared in<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Default Initialization<\/span><\/td>\n<td><span style=\"font-weight: 400\">Automatically initialized to 0 if not explicitly initialized<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains garbage value if not explicitly initialized<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Memory<\/span><\/td>\n<td><span style=\"font-weight: 400\">Stored in data segment of memory<\/span><\/td>\n<td><span style=\"font-weight: 400\">Stored in stack segment of memory<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Naming<\/span><\/td>\n<td><span style=\"font-weight: 400\">Must have unique names<\/span><\/td>\n<td><span style=\"font-weight: 400\">Can have same name in different functions<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Examples Illustrating Differences<\/h3>\n<p><strong>Example 1:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\nint g = 10; \/\/ global variable\r\n\r\nvoid func() {\r\n  int x = 5; \/\/ local variable\r\n  \r\n  printf(\"%d \", x); \r\n  printf(\"%d\", g);\r\n}\r\n\r\nint main() {\r\n  func();\r\n  \r\n  printf(\"%d\", g); \/\/ works\r\n  \r\n  printf(\"%d\", x); \/\/ error, x doesn't exist here  \r\n}<\/pre>\n<p><strong>Output:<\/strong><br \/>\n5 10<br \/>\n10<br \/>\n(Compilation Error for the last printf statement)<\/p>\n<p><strong>Example 2:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\nint z = 100; \/\/ global variable\r\n\r\nvoid increment() {\r\n  z++;\r\n}\r\n\r\nvoid decrement() {\r\n  z--;\r\n}\r\n\r\nint main() {\r\n  increment();\r\n  decrement();\r\n\r\n  printf(\"%d\", z); \/\/ 98\r\n\r\n  return 0; \/\/ Added to return an exit code from the main function\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>98<\/p>\n<p><strong>Example 3:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\nvoid func() {\r\n  {\r\n    int x = 5; \r\n    \/\/ x exists here in this inner block\r\n    printf(\"Inside the first block: x = %d\\n\", x);\r\n  }\r\n\r\n  {\r\n    int x = 10;\r\n    \/\/ This is a different 'x' than the one in the first block\r\n    printf(\"Inside the second block: x = %d\\n\", x);\r\n  } \r\n}\r\n\r\nint main() {\r\n  func();\r\n  return 0;\r\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><strong>Inside the first block:<\/strong> x = 5<br \/>\n<strong>Inside the second block:<\/strong> x = 10<\/p>\n<h3>Formal Parameters as Local Variables<\/h3>\n<p>Formal parameters, as defined in a function signature, are treated as local variables within that function. These formal parameters are essentially placeholders for values that will be passed to the function when it is called. The function can then operate on these parameters just like any other local variable declared within the function.<\/p>\n<p><strong>Here&#8217;s a breakdown of the concept:<\/strong><\/p>\n<p><strong>1) Parameter Declaration:<\/strong> When you declare a function in C, you specify its parameters in the function signature. For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void sum(int x, int y)<\/pre>\n<p>In this case, int x and int y are formal parameters, and they serve as placeholders for the values that will be passed to the sum function.<\/p>\n<p><strong>2) Local Variable Scope:<\/strong> Once defined as formal parameters, x and y behave like any other local variables declared within the function. They are only accessible within the scope of the function in which they are defined. This means:<\/p>\n<ul>\n<li>They can be used to perform calculations, store intermediate results, or perform any other task within the function&#8217;s body.<\/li>\n<li>They cannot be accessed or modified from outside the function. Attempts to access x and y from outside the sum function would result in compilation errors.<\/li>\n<\/ul>\n<p><strong>3) Local Variable Behavior:<\/strong> The behavior of formal parameters is consistent with that of local variables:<\/p>\n<ul>\n<li>They have a limited lifetime that corresponds to the duration of the function call. When the function call ends, the formal parameters cease to exist.<\/li>\n<li>They follow the scoping rules, meaning that they can shadow (have the same name as) variables declared in higher-level scopes without causing conflicts. However, the local variables within the function take precedence over any variables with the same name in the outer scope.<\/li>\n<\/ul>\n<p><strong>4) Use in Calculations:<\/strong> In the example provided, int result = x + y demonstrates how formal parameters can be used in calculations within the function. Here, x and y are treated just like any other integer variables, and their values are added together to compute the result.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\n\/* Function declaration *\/\r\nint sum(int a, int b);\r\n\r\n\/* Global variable declaration *\/\r\nint global_a = 50;\r\n\r\nint main() {\r\n    \/* Local variable declaration in main function *\/\r\n    int local_a = 30;\r\n    int b = 40;\r\n    int c = 0;\r\n\r\n    printf(\"Print statement in main(): Value of local_a = %d\\n\", local_a);\r\n    c = sum(local_a, b);\r\n    printf(\"Print statement in main(): Value of c after sum() = %d\\n\", c);\r\n\r\n    return 0;\r\n}\r\n\r\n\/* Function definition to add two integers *\/\r\nint sum(int a, int b) {\r\n    printf(\"Print statement in sum(): Value of a = %d\\n\", a);\r\n    printf(\"Print statement in sum(): Value of b = %d\\n\", b);\r\n\r\n    return a + b;\r\n}<\/pre>\n<p><strong>Output:<\/strong><br \/>\n<strong>Print statement in main():<\/strong> Value of local_a = 30<br \/>\n<strong>Print statement in sum():<\/strong> Value of a = 30<br \/>\n<strong>Print statement in sum():<\/strong> Value of b = 40<br \/>\n<strong>Print statement in main():<\/strong> Value of c after sum() = 70<\/p>\n<h3>Conclusion<\/h3>\n<p>Understanding local and global variable scope is crucial for any C programmer. Local variables promote encapsulation, while global variables allow state sharing. Knowing their differences, advantages, proper usage, and initialization is key to writing robust C code. Follow best practices on utilization to create efficient and modular programs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Variables play a pivotal role in any programming language. They allow developers to store data during program execution for later use. However, not all variables behave the same &#8211; their accessibility within a program&#46;&#46;&#46;<\/p>\n","protected":false},"author":86671,"featured_media":123730,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19488],"tags":[23914,29133,2263,29479,29548,29944,29546,29943],"class_list":["post-123273","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-c-programming","tag-c-tutorials","tag-c","tag-c-local-and-global-variable","tag-difference-between-local-and-global-variables-in-c","tag-local-and-global-variables-in-c","tag-local-vs-global-variables-in-c","tag-variable-scope-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Variable Scope in C \u2013 Local vs Global - DataFlair<\/title>\n<meta name=\"description\" content=\"This article will provide an in-depth look at local and global variables. Local variables promote encapsulation while global variables allow state sharing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Variable Scope in C \u2013 Local vs Global - DataFlair\" \/>\n<meta property=\"og:description\" content=\"This article will provide an in-depth look at local and global variables. Local variables promote encapsulation while global variables allow state sharing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-07T12:30:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-07T13:28:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Scope-of-Variables-in-C.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Variable Scope in C \u2013 Local vs Global - DataFlair","description":"This article will provide an in-depth look at local and global variables. Local variables promote encapsulation while global variables allow state sharing.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/","og_locale":"en_US","og_type":"article","og_title":"Variable Scope in C \u2013 Local vs Global - DataFlair","og_description":"This article will provide an in-depth look at local and global variables. Local variables promote encapsulation while global variables allow state sharing.","og_url":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-02-07T12:30:41+00:00","article_modified_time":"2024-02-07T13:28:40+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Scope-of-Variables-in-C.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"Variable Scope in C \u2013 Local vs Global","datePublished":"2024-02-07T12:30:41+00:00","dateModified":"2024-02-07T13:28:40+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/"},"wordCount":1199,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Scope-of-Variables-in-C.webp","keywords":["c programming","c tutorials","C++","c++ local and global variable","difference between local and global variables in c","local and global variables in c","local vs global variables in c","variable scope in c"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/","url":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/","name":"Variable Scope in C \u2013 Local vs Global - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Scope-of-Variables-in-C.webp","datePublished":"2024-02-07T12:30:41+00:00","dateModified":"2024-02-07T13:28:40+00:00","description":"This article will provide an in-depth look at local and global variables. Local variables promote encapsulation while global variables allow state sharing.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Scope-of-Variables-in-C.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Scope-of-Variables-in-C.webp","width":1200,"height":628,"caption":"Scope of Variables in C"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/variable-scope-in-c-local-vs-global\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"C Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/c-programming\/"},{"@type":"ListItem","position":3,"name":"Variable Scope in C \u2013 Local vs Global"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49","name":"TechVidvan Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","caption":"TechVidvan Team"},"description":"TechVidvan Team provides high-quality content &amp; courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.","url":"https:\/\/data-flair.training\/blogs\/author\/test001\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/86671"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=123273"}],"version-history":[{"count":9,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123273\/revisions"}],"predecessor-version":[{"id":131810,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123273\/revisions\/131810"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/123730"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=123273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=123273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=123273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}