{"id":3096,"date":"2024-05-10T11:38:24","date_gmt":"2024-05-10T11:38:24","guid":{"rendered":"https:\/\/www.skillvertex.com\/blog\/?p=3096"},"modified":"2024-05-10T11:38:24","modified_gmt":"2024-05-10T11:38:24","slug":"dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc","status":"publish","type":"post","link":"https:\/\/www.skillvertex.com\/blog\/dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc\/","title":{"rendered":"Dynamic Memory Allocation In C Using Malloc(), Calloc(), Free() And Realloc()"},"content":{"rendered":"\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\" id=\"rank-math-toc\"><p>Table of Contents<\/p><nav><ul><li ><a href=\"#dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc\">Dynamic Memory Allocation In C Using Malloc(), Calloc(), Free() And Realloc()<\/a><\/li><li ><a href=\"#dynamic-memory-allocation-in-c\">Dynamic Memory Allocation in C <\/a><\/li><li ><a href=\"#c-malloc-method\">C malloc() method<\/a><\/li><li ><a href=\"#syntax-of-malloc-in-c\">Syntax of malloc() in C<\/a><ul><li ><a href=\"#example-of-malloc-in-c\">Example of malloc() in C<\/a><\/li><\/ul><\/li><li ><a href=\"#c-calloc-method\">C calloc() method<\/a><ul><li ><a href=\"#example-of-calloc-in-c\">Example of calloc() in C<\/a><\/li><\/ul><\/li><li ><a href=\"#c-free-method\">C free() method<\/a><ul><li ><a href=\"#example-of-free-in-c\">Example of free() in C<\/a><\/li><\/ul><\/li><li ><a href=\"#c-realloc-method\">C realloc() method<\/a><\/li><li ><a href=\"#example-of-realloc-in-c\">Example of realloc() in C<\/a><\/li><li ><a href=\"#faq-dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc\">FAQ- Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc\">Dynamic Memory Allocation In C Using Malloc(), Calloc(), Free() And Realloc()<\/h2>\n\n\n\n<p>Dynamic memory allocation is a fundamental concept in the C programming language that allows developers to efficiently manage memory resources during runtime. Unlike static memory allocation, which defines memory usage at compile time, dynamic memory allocation enables programs to request and release memory as needed. This flexibility is particularly valuable when working with data structures of varying sizes or when you need to allocate memory for data structures whose size is not known until runtime. In C, this dynamic memory allocation is achieved through functions like <code>malloc()<\/code>, <code>calloc()<\/code>, <code>free()<\/code>, and <code>realloc()<\/code>. These functions provide the means to allocate memory, initialize it, release it, and even resize it, empowering programmers to optimize memory usage in their applications. This introductory guide will explore the usage of these functions, offering insights into how to harness their power for efficient memory management in C programming.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"dynamic-memory-allocation-in-c\">Dynamic Memory Allocation in C <\/h2>\n\n\n\n<p>Dynamic memory allocation is a fundamental concept that allows developers to adapt the size of data structures, such as arrays, during program execution. This adaptability is especially crucial when the actual size of the data structure cannot be determined at compile time or when it needs to change dynamically based on program requirements.<\/p>\n\n\n\n<p>The four library functions provided by C, namely <code>malloc()<\/code>, <code>calloc()<\/code>, <code>free()<\/code>, and <code>realloc()<\/code>, are key tools for implementing dynamic memory allocation. They empower programmers to allocate memory, initialize it, release it when no longer needed, and resize data structures, ensuring the efficient use of memory resources.<\/p>\n\n\n\n<p>Dynamic memory allocation is a powerful feature that enhances the flexibility and efficiency of C programming, enabling developers to create more adaptable and resource-efficient applications. It is particularly valuable in scenarios like the ones you&#8217;ve described, where the size of an array needs to be adjusted at runtime to prevent memory wastage or accommodate additional data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c-malloc-method\">C malloc() method<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Dynamic Memory Allocation:<\/strong> The <code>malloc<\/code> function in C is used to dynamically allocate a single large block of memory during runtime. This memory allocation is done based on the specified size provided as an argument to <code>malloc<\/code>.<\/li>\n\n\n\n<li><strong>Pointer Return Type:<\/strong> <code>malloc<\/code> returns a pointer of type <code>void<\/code>, which means it can be cast into a pointer of any data type. Programmers typically cast this <code>void<\/code> pointer into the appropriate data type pointer to work with the allocated memory.<\/li>\n\n\n\n<li><strong>Uninitialized Memory:<\/strong> One crucial aspect of <code>malloc<\/code> is that it does not initialize the memory it allocates. The memory block initially contains garbage values, which means the content of the allocated memory is indeterminate until you explicitly write values into it. It&#8217;s important for programmers to initialize the memory if necessary to avoid unexpected behavior in their programs.<\/li>\n<\/ol>\n\n\n\n<p>This function is widely used for dynamic memory allocation in C and is the first step in allocating memory for various data structures, such as arrays, linked lists, and more. To ensure predictable behavior, it&#8217;s essential to initialize the allocated memory to the desired values before using it in your program.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"syntax-of-malloc-in-c\">Syntax of malloc() in C<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>ptr = (cast-type*) malloc(byte-size)\nFor Example:<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ptr = (int*) malloc(100 * sizeof(int));\nDue  the size of int is 4 bytes, this statement will allocate 400 bytes of memory. Thus, the pointer ptr holds the address of the first byte in the allocated memory.<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-malloc-in-c\">Example of malloc() in C<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n \nint main()\n{\n \n    \/\/ This pointer will hold the\n    \/\/ base address of the block created\n    int* ptr;\n    int n, i;\n \n    \/\/ Get the number of elements for the array\n    printf(\"Enter number of elements:\");\n    scanf(\"%d\",&amp;n);\n    printf(\"Entered number of elements: %d\\n\", n);\n \n    \/\/ Dynamically allocate memory using malloc()\n    ptr = (int*)malloc(n * sizeof(int));\n \n    \/\/ Check if the memory has been successfully\n    \/\/ allocated by malloc or not\n    if (ptr == NULL) {\n        printf(\"Memory not allocated.\\n\");\n        exit(0);\n    }\n    else {\n \/\/ Memory has been successfully allocated\n        printf(\"Memory successfully allocated using malloc.\\n\");\n \n        \/\/ Get the elements of the array\n        for (i = 0; i &lt; n; ++i) {\n            ptr&#91;i] = i + 1;\n        }\n \n        \/\/ Print the elements of the array\n        printf(\"The elements of the array are: \");\n        for (i = 0; i &lt; n; ++i) {\n            printf(\"%d, \", ptr&#91;i]);\n        }\n    }\n \n    return 0;\n}<\/code><\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter number of elements: 5\nMemory successfully allocated using malloc.\nThe elements of the array are: 1, 2, 3, 4, 5,\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c-calloc-method\">C calloc() method<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Dynamic Memory Allocation:<\/strong> The <code>calloc<\/code> function in C is used for dynamic memory allocation, much like the <code>malloc<\/code> function. It allows you to allocate memory for a specified number of blocks of a specified type during program execution.<\/li>\n\n\n\n<li><strong>Initialization to Zero:<\/strong> One significant difference between <code>calloc<\/code> and <code>malloc<\/code> is that <code>calloc<\/code> initializes each block of memory with a default value of &#8216;0&#8217;. This means that the memory allocated by <code>calloc<\/code> is set to zeros by default. This can be useful when you want to ensure that the allocated memory starts with a known initial state.<\/li>\n\n\n\n<li><strong>Two Parameters:<\/strong> <code>calloc<\/code> takes two parameters or arguments: the number of blocks you want to allocate and the size of each block in bytes. In contrast, <code>malloc<\/code> typically takes a single argument, which is the total size of memory to allocate.<\/li>\n<\/ol>\n\n\n\n<p><code>calloc<\/code> is often used when you want to allocate and initialize an array of elements, and you want to ensure that all elements start with a default value of zero. This can be helpful in scenarios where you need to work with arrays or matrices and want to avoid any unpredictable values in the allocated memory.<\/p>\n\n\n\n<p>So, while <code>calloc<\/code> and <code>malloc<\/code> serve the same general purpose of dynamic memory allocation, they differ in their behavior regarding memory initialization and the number of parameters they accept.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax of calloc() in C<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>ptr = (cast-type*)calloc(n, element-size);\nhere, n is the no. of elements and element-size is the size of each element.<\/code><\/pre>\n\n\n\n<p>Example<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ptr = (float*) calloc(25, sizeof(float));\nThis statement can allocate acontiguous space in memory for 25 elements whereas, each element with the size of the float. <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-calloc-in-c\">Example of calloc() in C<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\n#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n \nint main()\n{\n \n    \/\/ This pointer will hold the\n    \/\/ base address of the block created\n    int* ptr;\n    int n, i;\n \n    \/\/ Get the number of elements for the array\n    n = 5;\n    printf(\"Enter number of elements: %d\\n\", n);\n \n    \/\/ Dynamically allocate memory using calloc()\n    ptr = (int*)calloc(n, sizeof(int));\n \n    \/\/ Check if the memory has been successfully\n    \/\/ allocated by calloc or not\n    if (ptr == NULL) {\n        printf(\"Memory not allocated.\\n\");\n        exit(0);\n    }\n    else {\n     \/\/ Memory has been successfully allocated\n        printf(\"Memory successfully allocated using calloc.\\n\");\n \n        \/\/ Get the elements of the array\n        for (i = 0; i &lt; n; ++i) {\n            ptr&#91;i] = i + 1;\n        }\n \n        \/\/ Print the elements of the array\n        printf(\"The elements of the array are: \");\n        for (i = 0; i &lt; n; ++i) {\n            printf(\"%d, \", ptr&#91;i]);\n        }\n    }\n \n    return 0;\n}<\/code><\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter number of elements: 5\nMemory successfully allocated using calloc.\nThe elements of the array are: 1, 2, 3, 4, 5,<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c-free-method\">C free() method<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Dynamic Memory Deallocation:<\/strong> The <code>free<\/code> function in C is used to dynamically deallocate (release) memory that was previously allocated using functions like <code>malloc<\/code> and <code>calloc<\/code>.<\/li>\n\n\n\n<li><strong>Manual Memory Management:<\/strong> Memory allocated using <code>malloc<\/code> and <code>calloc<\/code> is not automatically deallocated by the program; it remains allocated until explicitly released. This manual memory management is a fundamental responsibility of the programmer.<\/li>\n\n\n\n<li><strong>Wastage Reduction:<\/strong> One of the primary purposes of the <code>free<\/code> function is to reduce memory wastage. By releasing memory that is no longer needed, the program can make efficient use of available memory resources.<\/li>\n<\/ol>\n\n\n\n<p>It&#8217;s important to note that not properly freeing memory can lead to memory leaks, where memory is allocated but never released, causing the program&#8217;s memory consumption to grow over time. Therefore, it&#8217;s a good practice to use <code>free<\/code> to release memory as soon as it is no longer required within your program to ensure efficient memory management.<\/p>\n\n\n\n<p><strong>Syntax of free() in C<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>free(ptr);\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-free-in-c\">Example of free() in C<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n \nint main()\n{\n \n    \/\/ This pointer will hold the\n    \/\/ base address of the block created\n    int *ptr, *ptr1;\n    int n, i;\n \n    \/\/ Get the number of elements for the array\n    n = 5;\n    printf(\"Enter number of elements: %d\\n\", n);\n \n    \/\/ Dynamically allocate memory using malloc()\n    ptr = (int*)malloc(n * sizeof(int));\n \n    \/\/ Dynamically allocate memory using calloc()\n    ptr1 = (int*)calloc(n, sizeof(int));\n \n    \/\/ Check if the memory has been successfully\n    \/\/ allocated by malloc or not\n    if (ptr == NULL || ptr1 == NULL) {\n        printf(\"Memory not allocated.\\n\");\n        exit(0);\n    }\n    else {\n \n        \/\/ Memory has been successfully allocated\n        printf(\"Memory successfully allocated using malloc.\\n\");\n \n        \/\/ Free the memory\n        free(ptr);\n        printf(\"Malloc Memory successfully freed.\\n\");\n \n        \/\/ Memory has been successfully allocated\n        printf(\"\\nMemory successfully allocated using calloc.\\n\");\n \n        \/\/ Free the memory\n        free(ptr1);\n        printf(\"Calloc Memory successfully freed.\\n\");\n    }\n \n    return 0;\n}<\/code><\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter number of elements: 5\nMemory successfully allocated using malloc.\nMalloc Memory successfully freed.\n\nMemory successfully allocated using calloc.\nCalloc Memory successfully freed.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c-realloc-method\">C realloc() method<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Dynamic Memory Reallocation:<\/strong> The <code>realloc<\/code> function in C is used to dynamically change the memory allocation of a previously allocated memory block. This allows you to resize the memory block allocated by <code>malloc<\/code> or <code>calloc<\/code> during runtime.<\/li>\n\n\n\n<li><strong>Insufficient Memory:<\/strong> <code>realloc<\/code> is particularly useful when the previously allocated memory is insufficient to hold the data or elements you want to store. It enables you to increase or decrease the size of the memory block to accommodate the new requirements.<\/li>\n\n\n\n<li><strong>Data Preservation:<\/strong> When you use <code>realloc<\/code> to increase the size of the memory block, it preserves the data that is already present in the existing memory. In other words, the data from the original memory block is retained in the new, larger memory block. However, any newly allocated memory within the resized block will contain garbage values unless explicitly initialized.<\/li>\n\n\n\n<li><strong>Efficient Memory Usage:<\/strong> <code>realloc<\/code> helps in efficient memory usage by allowing you to adapt the memory allocation to your program&#8217;s needs without unnecessary memory wastage or the risk of buffer overflows.<\/li>\n<\/ol>\n\n\n\n<p>Overall, <code>realloc<\/code> is a powerful tool for managing memory efficiently in C programs, as it gives you the flexibility to adjust memory sizes dynamically to meet changing requirements while retaining existing data.<\/p>\n\n\n\n<p><strong>Syntax of realloc() in C<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ptr = realloc(ptr, newSize);\nwhere ptr is reallocated with new size 'newSize'.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example-of-realloc-in-c\">Example of realloc() in C<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\n#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n \nint main()\n{\n \n    \/\/ This pointer will hold the\n    \/\/ base address of the block created\n    int* ptr;\n    int n, i;\n \n    \/\/ Get the number of elements for the array\n    n = 5;\n    printf(\"Enter number of elements: %d\\n\", n);\n \n    \/\/ Dynamically allocate memory using calloc()\n    ptr = (int*)calloc(n, sizeof(int));\n \n    \/\/ Check if the memory has been successfully\n    \/\/ allocated by malloc or not\n    if (ptr == NULL) {\n        printf(\"Memory not allocated.\\n\");\n        exit(0);\n    }\n    else {\n\/\/ Memory has been successfully allocated\n        printf(\"Memory successfully allocated using calloc.\\n\");\n \n        \/\/ Get the elements of the array\n        for (i = 0; i &lt; n; ++i) {\n            ptr&#91;i] = i + 1;\n        }\n \n        \/\/ Print the elements of the array\n        printf(\"The elements of the array are: \");\n        for (i = 0; i &lt; n; ++i) {\n            printf(\"%d, \", ptr&#91;i]);\n        }\n \n        \/\/ Get the new size for the array\n        n = 10;\n        printf(\"\\n\\nEnter the new size of the array: %d\\n\", n);\n \n        \/\/ Dynamically re-allocate memory using realloc()\n        ptr = (int*)realloc(ptr, n * sizeof(int));\n \n        \/\/ Memory has been successfully allocated\n        printf(\"Memory successfully re-allocated using realloc.\\n\");\n \n        \/\/ Get the new elements of the array\n        for (i = 5; i &lt; n; ++i) {\n            ptr&#91;i] = i + 1;\n        }\n \n        \/\/ Print the elements of the array\n        printf(\"The elements of the array are: \");\n        for (i = 0; i &lt; n; ++i) {\n            printf(\"%d, \", ptr&#91;i]);\n        }\n \n        free(ptr);\n    }\n \n    return 0;\n}<\/code><\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter number of elements: 5\nMemory successfully allocated using calloc.\nThe elements of the array are: 1, 2, 3, 4, 5, \n\nEnter the new size of the array: 10\nMemory successfully re-allocated using realloc.\nThe elements of the array are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq-dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc\">FAQ- Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()<\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1698656600752\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q1. What is dynamic memory allocation malloc and calloc in C?<\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. <code>malloc()<\/code> and <code>calloc()<\/code> are C functions for dynamic memory allocation.<br \/>The key difference is that <code>malloc()<\/code> requires one argument for the total memory size and leaves it uninitialized, while <code>calloc()<\/code> needs two arguments: the number of elements and their size, and it initializes the memory to zero.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1698656616554\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q2. Under which header file are dynamic memory allocation functions such as calloc malloc realloc and free provided?<\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. To allocate memory dynamically in C, you can use library functions like <code>malloc()<\/code>, <code>calloc()<\/code>, <code>realloc()<\/code>, and <code>free()<\/code>. These functions are part of the <code>&lt;stdlib.h><\/code> header file.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1698656630790\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q3. What is better calloc and malloc?<\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. <br \/><code>calloc()<\/code> zero-initializes memory, good for when initialization is crucial, with a minor performance cost.<br \/><code>malloc()<\/code> leaves memory uninitialized, faster if performance matters and initialization isn&#8217;t needed.<br \/><code>calloc()<\/code> can save you from calling <code>memset()<\/code> to zero out memory.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Dynamic Memory Allocation In C Using Malloc(), Calloc(), Free() And Realloc() Dynamic memory allocation is a fundamental concept in the C programming language that allows developers to efficiently manage memory resources during runtime. Unlike static memory allocation, which defines memory usage at compile time, dynamic memory allocation enables programs to request and release memory as &#8230; <a title=\"Dynamic Memory Allocation In C Using Malloc(), Calloc(), Free() And Realloc()\" class=\"read-more\" href=\"https:\/\/www.skillvertex.com\/blog\/dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc\/\" aria-label=\"More on Dynamic Memory Allocation In C Using Malloc(), Calloc(), Free() And Realloc()\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":3100,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[513,512],"class_list":["post-3096","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-calloc","tag-dynamic-memory-allocation-in-c-using-malloc","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"_links":{"self":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/3096","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/comments?post=3096"}],"version-history":[{"count":12,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/3096\/revisions"}],"predecessor-version":[{"id":10747,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/3096\/revisions\/10747"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/media\/3100"}],"wp:attachment":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/media?parent=3096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/categories?post=3096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/tags?post=3096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}