

{"id":123319,"date":"2024-02-21T18:00:21","date_gmt":"2024-02-21T12:30:21","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=123319"},"modified":"2024-02-21T18:03:45","modified_gmt":"2024-02-21T12:33:45","slug":"difference-between-macros-and-functions-in-c","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/","title":{"rendered":"Difference Between Macros and Functions in C"},"content":{"rendered":"<p>Modular and reusable code is essential for managing complexity in large C programs. C provides two ways to achieve modularity &#8211; macros and functions. While they aim to solve similar problems, macros and functions have important behavioral differences that impact correctness, performance, debugging, and maintenance.<\/p>\n<p>In this article, we dive deeper into macros and functions in C. We explain their syntax, show example usages, highlight the key differences, and offer guidance on when each should be used based on context. Gaining a nuanced understanding of the pros and cons of C macros vs functions will level up your ability to write cleaner, more maintainable code.<\/p>\n<h2>Macros in C<\/h2>\n<p>A macro in C is a fragment of code that has been given a name using #define. Whenever the macro name is encountered by the preprocessor, it is replaced by the macro&#8217;s definition.<\/p>\n<p><strong>Here is an example macro definition:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#define MAX(a,b) ((a) &gt; (b) ? (a) : (b))<\/pre>\n<p>This defines a macro MAX that will expand to an expression that evaluates to the maximum of a and b.<\/p>\n<p>Macros can be used in place of any token in C code.<\/p>\n<p><strong>For example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int larger = MAX(5, 2);<\/pre>\n<p><strong>When compiled, this code will transform into:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int larger = ((5) &gt; (2) ? (5) : (2));<\/pre>\n<h4>The key advantages of macros in C are:<\/h4>\n<ul>\n<li>They enable code generation from simple text replacement<\/li>\n<li>The preprocessor replaces macros before compilation, so there is no runtime cost<\/li>\n<\/ul>\n<h4>But macros also have disadvantages:<\/h4>\n<ul>\n<li>Lack of type safety since token replacement is untyped<\/li>\n<li>Harder debugging since macro expansions are invisible<\/li>\n<li>Code bloat if macro definitions are large<\/li>\n<\/ul>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macros-also-have-disadvantages.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-130743 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macros-also-have-disadvantages.webp\" alt=\"macros also have disadvantages\" width=\"400\" height=\"210\" \/><\/a><\/p>\n<h3>Functions in C<\/h3>\n<p>A function in C is a reusable block of code that is defined once but can be called from multiple places. It allows passing data through arguments, performing operations, and optionally returning a result.<\/p>\n<p><strong>Here is an example function definition:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int max(int a, int b) {\r\n  if (a &gt; b) {\r\n    return a; \r\n  } else {\r\n    return b;\r\n  }\r\n}<\/pre>\n<p>This defines a function called max that accepts two int arguments, compares them, and returns the greater one.<\/p>\n<p><strong>Unlike macros, functions must be explicitly called to execute their code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int larger = max(5, 2);<\/pre>\n<p>The max function will be called with the arguments 5 and 2. It will return the value 5 which is assigned to the variable larger.<\/p>\n<h4>Key advantages of functions in C:<\/h4>\n<ul>\n<li>Encapsulation of code in one place<\/li>\n<li>Type safety for arguments and return values<\/li>\n<li>Increased modularity and reusability<\/li>\n<li>Easier to debug with stack traces<\/li>\n<\/ul>\n<h4>Disadvantages include:<\/h4>\n<ul>\n<li>Runtime overhead when calling functions<\/li>\n<li>The state does not persist between calls<\/li>\n<\/ul>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Disadvantages-include.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-130744 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Disadvantages-include.webp\" alt=\"Disadvantages include\" width=\"400\" height=\"210\" \/><\/a><\/p>\n<h3>Key Differences Between Macro and Function in C<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>Feature<\/b><\/td>\n<td><b>Macro<\/b><\/td>\n<td><b>Function<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Definition<\/span><\/td>\n<td><span style=\"font-weight: 400\">Defined using <\/span><span style=\"font-weight: 400\">#define<\/span><span style=\"font-weight: 400\">, no prototype<\/span><\/td>\n<td><span style=\"font-weight: 400\">Declared with return type, name, and parameters. May have a prototype.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Expansion<\/span><\/td>\n<td><span style=\"font-weight: 400\">Expanded inline, direct text replacement<\/span><\/td>\n<td><span style=\"font-weight: 400\">Executed at runtime, it can be called multiple times<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Performance<\/span><\/td>\n<td><span style=\"font-weight: 400\">No runtime overhead, direct substitution<\/span><\/td>\n<td><span style=\"font-weight: 400\">Some overhead from calls due to stack, parameters<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Parameters<\/span><\/td>\n<td><span style=\"font-weight: 400\">Can have arguments but no type-checking<\/span><\/td>\n<td><span style=\"font-weight: 400\">Have typed parameters checked by the compiler<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Scope<\/span><\/td>\n<td><span style=\"font-weight: 400\">Can access globals and manipulate source code<\/span><\/td>\n<td><span style=\"font-weight: 400\">Have local variables and operate in your own scope<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Structure<\/span><\/td>\n<td><span style=\"font-weight: 400\">Not being aware of program structure can cause side effects<\/span><\/td>\n<td><span style=\"font-weight: 400\">Modular promotes code reusability and maintainability<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Use Cases<\/span><\/td>\n<td><span style=\"font-weight: 400\">Conditional compilation, code generation, text manipulation<\/span><\/td>\n<td><span style=\"font-weight: 400\">Encapsulate operations, organize and improve readability<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Resolution<\/span><\/td>\n<td><span style=\"font-weight: 400\">Resolved during preprocessing before compilation<\/span><\/td>\n<td><span style=\"font-weight: 400\">Resolved during compilation and linking<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Debugging<\/span><\/td>\n<td><span style=\"font-weight: 400\">Hard to debug, no trace of macro expansion<\/span><\/td>\n<td><span style=\"font-weight: 400\">Can step through function code during debugging<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Abstraction<\/span><\/td>\n<td><span style=\"font-weight: 400\">No abstraction, text substitution<\/span><\/td>\n<td><span style=\"font-weight: 400\">Provides abstraction through modularization<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Testing<\/span><\/td>\n<td><span style=\"font-weight: 400\">Hard to unit test macros<\/span><\/td>\n<td><span style=\"font-weight: 400\">Functions can be tested independently<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Examples<\/h3>\n<h4>Macro in C Example:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ Define a macro to calculate max of two numbers \r\n#define MAX(a,b) ((a) &gt; (b) ? (a) : (b))\r\n\r\nint main() {\r\n\r\n  \/\/ Use the macro \r\n  int x = MAX(5, 2);\r\n  \r\n  printf(\"Max is %d\", x); \/\/ Expands to ((5) &gt; (2) ? (5) : (2))\r\n  \r\n  return 0;\r\n}<\/pre>\n<p><strong>Output:<\/strong> Max is 5<\/p>\n<h4>Function in C Example:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ Function to calculate max of two numbers\r\nint max(int a, int b) {\r\n  if(a &gt; b) {\r\n    return a; \r\n  } else {\r\n    return b;\r\n  }\r\n}\r\n\r\nint main() {\r\n\r\n  \/\/ Call the function\r\n  int x = max(5, 2); \r\n  \r\n  printf(\"Max is %d\", x);\r\n  \r\n  return 0;  \r\n}<\/pre>\n<p><strong>Output:<\/strong> Max is 5<\/p>\n<h3>When to Use Each Construct<\/h3>\n<p><strong>Given their different strengths, here are guidelines on when macros or functions are most appropriate:<\/strong><\/p>\n<ul>\n<li>Use macros when you need textual code generation, for simple constants, and for performance in cases where type safety is not required.<\/li>\n<li>Use functions for more complex imperative logic when type safety is desired and for easier debugging and maintenance.<\/li>\n<li>Use inline functions to get both macro-like compile time expansion and type safety.<\/li>\n<\/ul>\n<p><strong>For example:<\/strong><\/p>\n<ul>\n<li>Math operations like MIN\/MAX can be macros since performance is important and type safety is less relevant.<\/li>\n<li>More complex algorithms, like a sorting function, should be an actual function for robustness and debugging.<\/li>\n<li>Simple accessor methods can be inline functions to optimize performance while retaining modular code.<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>Macros and functions are fundamental constructs in C that enable modular and reusable code. While they have some high-level similarities, differences in their expansion, type safety, performance, debugging, and maintenance make each construct shine in different situations.<\/p>\n<p>Keep these key differences in mind when designing C code so you can use the best tool for each task. Leverage macros for simple code generation and functions for more robust logic and encapsulation. With both macros and functions in your toolbox, you can write C code that balances power, performance and maintainability.<\/p>\n<p>Macros are now considered problematic in modern C++ programming due to several drawbacks. A better alternative is to use inline functions and const variables.<\/p>\n<h4>Below are some key issues with macros:<\/h4>\n<ul>\n<li>No type checking is performed, leading to possible errors.<\/li>\n<li>Debugging can be difficult since macros simply replace code segments.<\/li>\n<li>Macros lack namespaces, so defining a macro in one file can inadvertently affect other code.<\/li>\n<li>Side effects can occur with macros that evaluate arguments multiple times.<\/li>\n<\/ul>\n<p>Overall, macros should be avoided in favor of inline functions for code generalization. Const variables can also provide constant values without the downsides of macros. Modern C++ style prefers these approaches over problematic preprocessor macros.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modular and reusable code is essential for managing complexity in large C programs. C provides two ways to achieve modularity &#8211; macros and functions. While they aim to solve similar problems, macros and functions&#46;&#46;&#46;<\/p>\n","protected":false},"author":86671,"featured_media":123932,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19488],"tags":[29973,23914,29133,2263,29975,29974,29976,29972],"class_list":["post-123319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-c-macros-vs-functions","tag-c-programming","tag-c-tutorials","tag-c","tag-comparison-between-macros-and-functions-in-c","tag-difference-between-macros-and-functions-in-c","tag-macros-and-functions-in-c","tag-macros-vs-functions-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Difference Between Macros and Functions in C - DataFlair<\/title>\n<meta name=\"description\" content=\"Macros and functions are fundamental constructs in C. While macros for simple code generation and functions for more robust logic and encapsulation.\" \/>\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\/difference-between-macros-and-functions-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Difference Between Macros and Functions in C - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Macros and functions are fundamental constructs in C. While macros for simple code generation and functions for more robust logic and encapsulation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-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-21T12:30:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-21T12:33:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macro-and-function-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=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Difference Between Macros and Functions in C - DataFlair","description":"Macros and functions are fundamental constructs in C. While macros for simple code generation and functions for more robust logic and encapsulation.","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\/difference-between-macros-and-functions-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Difference Between Macros and Functions in C - DataFlair","og_description":"Macros and functions are fundamental constructs in C. While macros for simple code generation and functions for more robust logic and encapsulation.","og_url":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-02-21T12:30:21+00:00","article_modified_time":"2024-02-21T12:33:45+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macro-and-function-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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"Difference Between Macros and Functions in C","datePublished":"2024-02-21T12:30:21+00:00","dateModified":"2024-02-21T12:33:45+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/"},"wordCount":895,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macro-and-function-in-c.webp","keywords":["c macros vs functions","c programming","c tutorials","C++","comparison between macros and functions in c","difference between macros and functions in c","macros and functions in c","macros vs functions in c"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/","url":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/","name":"Difference Between Macros and Functions in C - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macro-and-function-in-c.webp","datePublished":"2024-02-21T12:30:21+00:00","dateModified":"2024-02-21T12:33:45+00:00","description":"Macros and functions are fundamental constructs in C. While macros for simple code generation and functions for more robust logic and encapsulation.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-in-c\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macro-and-function-in-c.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/macro-and-function-in-c.webp","width":1200,"height":628,"caption":"macro and function in c"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/difference-between-macros-and-functions-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":"Difference Between Macros and Functions 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\/123319","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=123319"}],"version-history":[{"count":10,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123319\/revisions"}],"predecessor-version":[{"id":134015,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/123319\/revisions\/134015"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/123932"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=123319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=123319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=123319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}