

{"id":123499,"date":"2024-02-22T18:00:31","date_gmt":"2024-02-22T12:30:31","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=123499"},"modified":"2024-03-09T14:00:19","modified_gmt":"2024-03-09T08:30:19","slug":"macros-with-arguments-in-c","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/","title":{"rendered":"Macros with Arguments in C"},"content":{"rendered":"<p>Macros are a powerful feature in C programming that allows you to define reusable code snippets. Macros with arguments take this a step further, enabling you to create versatile and customizable code blocks.<\/p>\n<p>In this article, we&#8217;ll explore the concept of macros with arguments, provide examples, and illustrate their benefits through code snippets and outputs.<\/p>\n<h2>Understanding Macros in C<\/h2>\n<p>Before diving into macros with arguments, let&#8217;s first understand what macros are. Macros are essentially a way to define simple text replacements. When the C preprocessor encounters a macro name in your code, it replaces it with the macro&#8217;s definition before the actual compilation of your code. Here&#8217;s a basic example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define PI 3.14159265\r\n\r\nint main() {\r\n    double radius = 5.0;\r\n    double area = PI * radius * radius;\r\n    printf(\"The area of the circle is: %lf\\n\", area);\r\n    return 0;\r\n}<\/pre>\n<p><strong>Output:<\/strong><br \/>\nThe area of the circle is: 78.539816<\/p>\n<p>In this code, PI is a macro that gets replaced with 3.14159265 during preprocessing. The output shows the calculated area of a circle using this macro.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2024\/02\/understanding-macros-in-c-output.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-134514 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2024\/02\/understanding-macros-in-c-output.webp\" alt=\"understanding macros in c output\" width=\"600\" height=\"61\" \/><\/a><\/p>\n<h3>Macros without Arguments in C<\/h3>\n<p>Initially, macros might appear to work like constants, but they have distinct advantages. Macros can be used for more than just replacing constants; they can replace any code snippet, which makes them extremely versatile.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define SQUARE(x) (x * x)\r\n\r\nint main() {\r\n    int result = SQUARE(5);\r\n    printf(\"The square of 5 is: %d\\n\", result);\r\n    return 0;\r\n}<\/pre>\n<p><strong>Output:<\/strong><br \/>\nThe square of 5 is: 25<\/p>\n<p>Here, SQUARE is a macro that squares its argument. SQUARE(5) causes the preprocessor to substitute (5 * 5) for it, producing the square of 5.<\/p>\n<h3>Introducing Macros with Arguments in C<\/h3>\n<p>Macros with arguments allow you to create dynamic code replacements by passing values to the macro. Here&#8217;s an easy instance:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define ADD(x, y) (x + y)\r\n\r\nint main() {\r\n    int sum = ADD(3, 7);\r\n    printf(\"The sum of 3 and 7 is: %d\\n\", sum);\r\n    return 0;\r\n}<\/pre>\n<p><strong>Output:<\/strong><br \/>\nThe sum of 3 and 7 is: 10<\/p>\n<p>In this situation, ADD is a macro that takes two arguments and returns their sum. The output shows the result of adding three and seven to the usage of this macro.<\/p>\n<h3>Important Key Points<\/h3>\n<ul>\n<li>Macro parameters must be valid C identifiers separated by commas and whitespace.<\/li>\n<li>A number of arguments passed must match the parameters defined in the macro.<\/li>\n<li>Leading and trailing whitespace in arguments is dropped, and the whitespace between tokens is reduced to a single space.<\/li>\n<li>Parentheses in arguments must balance; commas don&#8217;t end arguments.<\/li>\n<li>Square brackets and braces don&#8217;t need to balance in arguments.<\/li>\n<li>All arguments are fully macro-expanded before substitution into the macro body.<\/li>\n<li>Can leave macro arguments empty, this is not an error.<\/li>\n<li>Cannot omit arguments entirely; must match a number of parameters.<\/li>\n<li>Whitespace is not considered an argument, so foo() and foo( ) are the same.<\/li>\n<li>Macro parameters inside string literals are not replaced.<\/li>\n<li>A macro in C cannot directly call a preprocessor command.<\/li>\n<\/ul>\n<h3>Benefits of Macros with Arguments in C<\/h3>\n<p><strong>Code Reusability:<\/strong> Macros with arguments promote code reusability. You can use the equal macro with distinctive arguments all through your codebase, lowering redundancy and making your code greater maintainable.<br \/>\n<strong>Improved Readability:<\/strong> Macros with arguments can also improve code readability by encapsulating complicated operations into concise and descriptive names.<br \/>\n<strong>Debugging:<\/strong> During debugging, macros with arguments may be beneficial because you could without difficulty, trace returned to the unique code that generated an issue.<\/p>\n<h3>Macro Tricks<\/h3>\n<ul>\n<li><strong>Use the comma operator to have multiple expressions in a macro:<\/strong> #define NoisyInc(x) (puts(&#8220;incrementing&#8221;), (x)++)<\/li>\n<li><strong>Can use ternary operator for alternatives:<\/strong> #define Max(a,b) ((a) &gt; (b) ? (a) : (b))<\/li>\n<li>Non-syntactic macros allow non-C syntax but can reduce readability.<\/li>\n<li><strong>Use do-while(0) loop to allow multi-statement macros:<\/strong> #define HiHi() do { puts(&#8220;hi&#8221;); puts(&#8220;hi&#8221;); } while(0)<\/li>\n<li>Stringify arguments with #x to expand macros in strings.<\/li>\n<li>Concatenate tokens with ## like FakeArray(n) -&gt; fakeArrayVariableNumber##n.<\/li>\n<li>Big macros can span multiple lines using backslash line continuation.<\/li>\n<li>Useful for custom debugging macros like assert using FILE and LINE.<\/li>\n<\/ul>\n<h3>Defining Macros with #define<\/h3>\n<p>The #define preprocessor directive can be used to define macros in C.<\/p>\n<p><strong>The basic syntax is:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define macro_name replacement_text<\/pre>\n<p>Whenever macro_name is encountered in the source code, it is replaced with the replacement_text before compilation.<\/p>\n<p><strong>For example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define c 299792458 \/\/ speed of light<\/pre>\n<p>Here, c would be replaced with 299792458 wherever it appears.<\/p>\n<p>#define can also be used to create function-like macros that work similarly to a function call:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define circleArea(r) (PI * (r) * (r))<\/pre>\n<p>When circleArea(x) is encountered, it expands to (PI * (x) * (x)).<\/p>\n<p><strong>Some key properties of #define macros:<\/strong><\/p>\n<ul>\n<li>Simple text substitution, no type-checking<\/li>\n<li>Can reduce code duplication<\/li>\n<li>Can obfuscate code if overused<\/li>\n<li>Useful for constants, code snippets, conditional compilation<\/li>\n<\/ul>\n<p>Overall, #define is a basic but powerful macro capability that is commonly used in C programs.<\/p>\n<h3>Examples<\/h3>\n<h4>Simple Macro Definition<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\n#define PI 3.14159265 \r\n\r\nint main() {\r\n  printf(\"Value of PI is %f\\n\", PI);\r\n  \r\n  return 0;\r\n}<\/pre>\n<p><strong>Output:<\/strong><br \/>\nValue of PI is 3.141593<\/p>\n<h4>Function-like Macro<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\n#define MIN(a, b) ((a) &lt; (b) ? (a) : (b))\r\n\r\nint main() {\r\n\r\n  int x = 5, y = 10, min;\r\n\r\n  min = MIN(x, y);\r\n\r\n  printf(\"Minimum of %d and %d is %d\\n\", x, y, min);\r\n\r\n  return 0;\r\n}<\/pre>\n<p><strong>Output:<\/strong><br \/>\nMinimum of 5 and 10 is 5<\/p>\n<h4>Predefined Macros with Arguments<\/h4>\n<p>C provides some predefined macros with arguments, like __LINE__ and __FILE__, which are useful for debugging and error handling.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\r\n\r\nint main() {\r\n    printf(\"This message is from line %d in file %s.\\n\", __LINE__, __FILE__);\r\n    return 0;\r\n}<\/pre>\n<p><strong>Output:<\/strong><br \/>\nThis message is from line 9 in file filename. c.<\/p>\n<p>The output provides the line number and file name where the printf statement is located, aiding in debugging.<\/p>\n<h3>\u00a0Predefined Macros in C<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>Macro<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">__DATE__<\/span><\/td>\n<td><span style=\"font-weight: 400\">Expands to a string literal containing the current compilation date<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">__FILE__<\/span><\/td>\n<td><span style=\"font-weight: 400\">Expands to a string literal containing the current source file name<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">__LINE__<\/span><\/td>\n<td><span style=\"font-weight: 400\">Expands to the integer line number of the current source line<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">__STDC__<\/span><\/td>\n<td><span style=\"font-weight: 400\">Expands to a nonzero integer constant if the compiler conforms to the ANSI C standard<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">__TIME__<\/span><\/td>\n<td><span style=\"font-weight: 400\">Expands to a string literal containing the current compilation time<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Variable Length Macro Arguments<\/h3>\n<p>C99 introduced support for variable length arguments in macros, similar to variadic functions. This allows macros to accept a variable number of arguments.<\/p>\n<p><strong>To define a variadic macro, the last parameter is specified as an ellipsis (&#8230;) like:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define LOG(...) printf(__VA_ARGS__)<\/pre>\n<p>The VA_ARGS token is used in the macro body to indicate where the variable arguments should be substituted.<\/p>\n<p><strong>When invoking a variadic macro, you can pass any number of comma-separated arguments:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">LOG(\"Hello\"); \/\/ 1 argument\r\nLOG(\"x =\", x, \"y =\", y); \/\/ 3 arguments<\/pre>\n<p>The arguments are still substituted in order, but the number can vary.<\/p>\n<h4>Some advantages of variadic macros:<\/h4>\n<ul>\n<li>Increased flexibility &#8211; macros can accept any number of arguments<\/li>\n<li>Can create wrapper macros like LOG above<\/li>\n<li>Useful for custom debugging\/logging macros<\/li>\n<\/ul>\n<h4>Some disadvantages:<\/h4>\n<ul>\n<li>Argument types not checked &#8211; can pass any types<\/li>\n<li>Harder to understand logic flow compared to fixed arguments<\/li>\n<\/ul>\n<p>Overall, variadic macros provide a powerful option for situations where the number of arguments may vary or can&#8217;t be known in advance. But they should be used carefully like any complex macro.<\/p>\n<h3>Best Practices for Using Macros with Arguments in C<\/h3>\n<p><strong>1. Naming Conventions<\/strong><br \/>\nWhen defining macros with arguments, follow naming conventions similar to regular C functions. Use uppercase letters and underscores to make your macros more readable.<\/p>\n<p><strong>2.\u00a0 Avoiding Common Pitfalls<\/strong><br \/>\nBe cautious with operator precedence in macro definitions. Enclose arguments and macro expressions in parentheses to avoid unexpected behavior.<\/p>\n<p><strong>3. Guidelines for Efficient Use<\/strong><br \/>\nUse macros with arguments judiciously. Overuse can lead to code that is hard to read and maintain.<\/p>\n<h3>Macro Argument Pitfalls<\/h3>\n<p>A common question that arises with macros and their arguments is: will the macro work correctly if the order of the actual arguments is different than the formal parameters in the macro definition?<\/p>\n<p><strong>For example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define MIN(x,y) ((x)&lt;(y)?(x):(y))\r\n\r\nint x=1,y=2,z;\r\nz = MIN(y,x);<\/pre>\n<p>Since macros work by simple text substitution, it may seem like the arguments are essentially treated like formal parameters, just in swapped positions. However, this specific case will work as expected.<\/p>\n<p>The key is that the preprocessor does not actually use the formal parameter names internally. Instead, it uses special tokens like #1 and #2 to indicate where the arguments should be substituted.<\/p>\n<p><strong>So the macro is internally represented like:<\/strong><br \/>\nMIN( #1 , #2 ) -&gt; (( #1 ) &lt; ( #2 ) ? ( #1 ) : ( #2 ))<\/p>\n<p>Therefore, swapping the argument order does not impact the logic. The preprocessor substitutes the first argument for #1 and second for #2 correctly.<\/p>\n<p>Problems can arise if the macro body references an identifier that is not a formal parameter but also appears in the expansion of a parameter. Additional techniques like adding underscores to macro-local variables can help avoid these issues.<\/p>\n<p>Overall, the preprocessor handles macro arguments robustly, enabling flexible use without confusion between formal and actual parameter positions.<\/p>\n<h3>Conclusion<\/h3>\n<p>The sturdy C characteristic of macros with arguments can appreciably enhance the reuse, readability, and debugging of code. Your code may be made extra adaptable and powerful by means of including custom code snippets that take arguments.<\/p>\n<p>In this article, we&#8217;ve included the fundamentals of macros with arguments, verified their usage, and highlighted their benefits. As you continue to discover C programming, don&#8217;t forget that macros with arguments are a treasured tool in your programming toolbox.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Macros are a powerful feature in C programming that allows you to define reusable code snippets. Macros with arguments take this a step further, enabling you to create versatile and customizable code blocks. In&#46;&#46;&#46;<\/p>\n","protected":false},"author":86671,"featured_media":131842,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19488],"tags":[20057,29978,23914,28585,23946,29977],"class_list":["post-123499","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-c-macros","tag-c-macros-with-arguments","tag-c-programming","tag-c-tutorial","tag-macros-in-c","tag-macros-with-arguments-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Macros with Arguments in C - DataFlair<\/title>\n<meta name=\"description\" content=\"We&#039;ll explore the concept of macros with arguments, provide examples, and illustrate their benefits through code snippets and outputs.\" \/>\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\/macros-with-arguments-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Macros with Arguments in C - DataFlair\" \/>\n<meta property=\"og:description\" content=\"We&#039;ll explore the concept of macros with arguments, provide examples, and illustrate their benefits through code snippets and outputs.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/\" \/>\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-22T12:30:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-09T08:30:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macros-with-arguments-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=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Macros with Arguments in C - DataFlair","description":"We'll explore the concept of macros with arguments, provide examples, and illustrate their benefits through code snippets and outputs.","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\/macros-with-arguments-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Macros with Arguments in C - DataFlair","og_description":"We'll explore the concept of macros with arguments, provide examples, and illustrate their benefits through code snippets and outputs.","og_url":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-02-22T12:30:31+00:00","article_modified_time":"2024-03-09T08:30:19+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macros-with-arguments-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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"Macros with Arguments in C","datePublished":"2024-02-22T12:30:31+00:00","dateModified":"2024-03-09T08:30:19+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/"},"wordCount":1352,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macros-with-arguments-in-c.webp","keywords":["C Macros","c macros with arguments","c programming","c tutorial","Macros in C","macros with arguments in c"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/","url":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/","name":"Macros with Arguments in C - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macros-with-arguments-in-c.webp","datePublished":"2024-02-22T12:30:31+00:00","dateModified":"2024-03-09T08:30:19+00:00","description":"We'll explore the concept of macros with arguments, provide examples, and illustrate their benefits through code snippets and outputs.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macros-with-arguments-in-c.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macros-with-arguments-in-c.webp","width":1200,"height":628,"caption":"macros with arguments in c"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/macros-with-arguments-in-c\/#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":"Macros with Arguments in C"}]},{"@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\/123499","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=123499"}],"version-history":[{"count":8,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123499\/revisions"}],"predecessor-version":[{"id":134516,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123499\/revisions\/134516"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/131842"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=123499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=123499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=123499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}