{"id":34569,"date":"2023-03-31T00:59:42","date_gmt":"2023-03-30T19:29:42","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/"},"modified":"2023-03-31T00:59:42","modified_gmt":"2023-03-30T19:29:42","slug":"solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/","title":{"rendered":"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#8217;t want to cheat, can you point the problem"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-75279720\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"75279720\" data-parentid=\"75273967\" data-score=\"0\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<ol>\n<li>When processing regular characters (final else clause) you read additional input instead of operating over <code>text<\/code>, i.e. instead of:<\/li>\n<\/ol>\n<pre><code>                scanf(\"%c\", &amp;document[parano][sentno][wordno][charno]);\n                printf(\"%c\\n\", document[parano][sentno][wordno][charno]);\n                charno++;\n<\/code><\/pre>\n<p>you want to do:<\/p>\n<pre><code>                document[parano][sentno][wordno][charno++] = text[i];\n<\/code><\/pre>\n<p>By the time we hit <code>text[i] == ' '<\/code> for the first time the value of <code>***document<\/code> is &#8220;3\\n1 2\\n2\\n&#8221; but you wanted it to be &#8220;Learning&#8221;.<\/p>\n<ol start=\"2\">\n<li>\n<p>(not fixed) When processing a word (`text[i] == &#8216; &#8216;) you expand current word, yet, you hard-code 1000 when you allocate it initially so this doesn&#8217;t make sense.  Be consistent.<\/p>\n<\/li>\n<li>\n<p><code>parano<\/code>, <code>sentno<\/code>, <code>wordno<\/code>, <code>charno<\/code> is indices but same suggest they are counts.  It&#8217;s not wrong just confusing and why you have to <code>wordno + 2<\/code> when relloc&#8217;ing.<\/p>\n<\/li>\n<li>\n<p>Terminate words with `\\0&#8242;.<\/p>\n<\/li>\n<li>\n<p>When you process &#8216; &#8216; you add another word which you may or may not need which is fine.  But when process a &#8216;.&#8217; you look ahead to the following letter is a <code>\\n<\/code> or not.  Be consistent.  If you look ahead then you need to check that <code>i + 1 &lt; len<\/code>, and it&#8217;s fragile, say, there is a stray space before the <code>\\n<\/code>.<\/p>\n<\/li>\n<li>\n<p>(not fixed) Memory leaks.  As the size of the sub-elements (paragraph, sentences and words) are private implementation details of <code>get_document()<\/code> you will have refactor the code to make those available.  I suggest:<\/p>\n<\/li>\n<\/ol>\n<pre><code>struct document {\n   char ****document;\n   size_t paragraphs;\n   size_t sentences;\n   size_t words;\n}\n<\/code><\/pre>\n<ol start=\"7\">\n<li>\n<p>(not fixed) Deduplicate.  Similar to the print functions, create a allocation function per type.<\/p>\n<\/li>\n<li>\n<p>(not fixed, really) <code>get_input_text()<\/code>.  You split the into paragraphs then concatenate everything again into a local variable then copy it into a dynamically allocated variable:<\/p>\n<\/li>\n<\/ol>\n<pre><code>   char *str = malloc(BUFFER_LEN);\n   for(size_t i = 0, l = 0; l &lt; lines &amp;&amp; i + 1 &lt; BUFFER_LEN; i += strlen(str + i)) {\n       int rv = fgets(str + i, BUFFER_LEN - i, stdin);\n       if(!rv) {\n          \/\/ handle error\n          break;\n       }\n   }\n   return s;\n<\/code><\/pre>\n<ol start=\"9\">\n<li>(not fixed) Separate i\/o from processing.  This simplifies testing and it makes it easier to figure out what is going on.  In <code>main(), you read a query type then 1 to 3 numbers.  <\/code>scanf()` tells you how many items where read so you simply do.  As you don&#8217;t use the kth_ functions for anything else just combine then with print_ funci<\/li>\n<\/ol>\n<pre><code>    int n = scanf(\"%d %d %d %d\", &amp;type, &amp;p, &amp;s, &amp;w);\n    switch(type) {\n        case 1:\n            if(n != 2) {\n              \/\/ handle error\n            }\n            print_paragraph(document, p);\n            break;\n        ...\n    }\n<\/code><\/pre>\n<ol start=\"10\">\n<li>\n<p>(not fixed) Add error checks for the remaining<code>malloc()<\/code>, <code>strdup()<\/code> etc.<\/p>\n<\/li>\n<li>\n<p>Don&#8217;t hard-code magic values (1000).  I introduced the constant <code>WORD_LEN<\/code> but you also have MAX_CHARACTERS which is kinda the same thing.<\/p>\n<\/li>\n<li>\n<p>(not fixed) Consider using <code>char *s = strpbrk(text + i, \" .\\n\")<\/code> to copy a word at a time.  It will simplify <code>\\0<\/code> handling, and likely to be faster than walking the <code>text<\/code> a byte at a time, i.e. <code>i += s - text + i<\/code>, just handle the <code>s == NULL<\/code> special case.<\/p>\n<\/li>\n<\/ol>\n<p>valgrind is now happy other than leaks (see above):<\/p>\n<pre><code>#include &lt;assert.h&gt;\n#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;string.h&gt;\n#define MAX_CHARACTERS 1005\n#define MAX_PARAGRAPHS 5\n#define WORD_LEN 1000\n\nchar *kth_word_in_mth_sentence_of_nth_paragraph(char ****document, int p, int s, int w) {\n    return document[p - 1][s - 1][w - 1];\n}\n\nchar **kth_sentence_in_mth_paragraph(char ****document, int p, int s) {\n    return document[p - 1][s - 1];\n}\n\nchar ***kth_paragraph(char ****document, int p) {\n    return document[p - 1];\n}\n\nchar ****get_document(char* text) {\n    char ****document = malloc(sizeof ***document);\n    *document = malloc(sizeof **document);\n    **document = malloc(sizeof *document);\n    ***document = malloc(WORD_LEN);\n\n    \/*  declare some numbers as iterators for the words, sentences,etc.*\/\n    int parano = 0;\n    int sentno = 0;\n    int wordno = 0;\n    int charno = 0;\n    \/*  now iterate over the text filling and expanding the document at the same time*\/\n    \/*----------------------------------------------------------------------------------------------------*\/\n    \/*  feading data in those spaces*\/\n    size_t len = strlen(text);\n    for (size_t i = 0; i &lt; len; i++) {\n        switch(text[i]) {\n            case ' ': {\n                document[parano][sentno][wordno][charno] = '\\0';\n\n                wordno++;\n                char **words = realloc(\n                    document[parano][sentno],\n                    (wordno + 1) * sizeof *document[parano][sentno]\n                );\n                if(!words) {\n                    printf(\"realloc of words failed\\n\");\n                    exit(1);\n                }\n                document[parano][sentno] = words;\n                document[parano][sentno][wordno] = malloc(WORD_LEN);\n                charno = 0;\n                break;\n            }\n            case '.': {\n                document[parano][sentno][wordno][charno] = '\\0';\n\n                sentno++;\n                char ***sentences = realloc(\n                    document[parano],\n                    (sentno + 1) * sizeof *document[parano]\n                );\n                if(!sentences) {\n                    printf(\"realloc of sentences failed\\n\");\n                    exit(1);\n                }\n                document[parano] = sentences;\n                document[parano][sentno] = malloc(sizeof **document);\n                wordno = 0;\n                document[parano][sentno][wordno] = malloc(WORD_LEN);\n                charno = 0;\n                break;\n            }\n            case '\\n': {\n                document[parano][sentno][wordno][charno] = '\\0';\n\n                parano++;\n                char ****paragraphs = realloc(\n                    document,\n                    (parano + 1) * sizeof *document\n                );\n                if(!paragraphs) {\n                    printf(\"realloc of paragraphs failed\\n\");\n                    exit(1);\n                }\n                document = paragraphs;\n                document[parano] = malloc(sizeof ***document);\n                sentno = 0;\n                document[parano][sentno] = malloc(sizeof **document);\n                wordno = 0;\n                document[parano][sentno][wordno] = malloc(WORD_LEN);\n                charno = 0;\n                break;\n            }\n            default: \/\/ character\n                document[parano][sentno][wordno][charno++] = text[i];\n        }\n    }\n    return document;\n}\n\nchar *get_input_text() {\n    int paragraph_count;\n    scanf(\"%d\", &amp;paragraph_count);\n    char p[MAX_PARAGRAPHS][MAX_CHARACTERS];\n    char doc[MAX_CHARACTERS];\n    memset(doc, 0, sizeof doc);\n    getchar();\n    for (int i = 0; i &lt; paragraph_count; i++) {\n        scanf(\"%[^\\n]%*c\", p[i]);\n        strcat(doc, p[i]);\n        if (i != paragraph_count - 1)\n            strcat(doc, \"\\n\");\n    }\n    return strdup(doc);\n}\n\nvoid print_word(char *word) {\n    printf(\"%s\", word);\n}\n\nvoid print_sentence(char **sentence) {\n    int word_count;\n    scanf(\"%d\", &amp;word_count);\n    for(int i = 0; i &lt; word_count; i++){\n        print_word(sentence[i]);\n        if(i + 1 != word_count)\n            printf(\" \");\n    }\n}\n\nvoid print_paragraph(char ***paragraph) {\n    int sentence_count;\n    scanf(\"%d\", &amp;sentence_count);\n    for (int i = 0; i &lt; sentence_count; i++) {\n        print_sentence(paragraph[i]);\n        printf(\".\");\n    }\n}\n\nint main() {\n    char *text = get_input_text();\n    char ****document = get_document(text);\n    int q;\n    scanf(\"%d\", &amp;q);\n    while (q--) {\n        int type;\n        scanf(\"%d\", &amp;type);\n        switch(type) {\n            case 1: {\n                int p;\n                scanf(\"%d\", &amp;p);\n                print_paragraph(kth_paragraph(document, p));\n                break;\n            }\n            case 2: {\n                int p, s;\n                scanf(\"%d %d\", &amp;p, &amp;s);\n                print_sentence(kth_sentence_in_mth_paragraph(document, p, s));\n                break;\n            }\n            case 3: {\n                int p, s, w;\n                scanf(\"%d %d %d\", &amp;p, &amp;s, &amp;w);\n                print_word(kth_word_in_mth_sentence_of_nth_paragraph(document, p, s, w));\n                break;\n            }\n            default:\n                printf(\"error\\n\");\n        }\n        printf(\"\\n\");\n    }\n    free(text);\n}\n<\/code><\/pre>\n<p>Output as expected:<\/p>\n<pre><code>Learning pointers is more fun.It is good to have pointers.\nLearning C is fun\nLearning\n<\/code><\/pre>\n<p>Btw, a whole different way of solving this is problem is keep the original input (<code>text<\/code>) then write functions to directly extract a paragraph, sentence or word from that string.  If you input is huge then create an index, say, (<code>paragraph<\/code>, <code>sentence<\/code>, <code>word<\/code>) to <code>&amp;text[i]<\/code>.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">1<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved i have been on this question for quaring the document for two days straight, and it is not working. don&#8217;t want to cheat, can you point the problem <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] When processing regular characters (final else clause) you read additional input instead of operating over text, i.e. instead of: scanf(&#8220;%c&#8221;, &amp;document[parano][sentno][wordno][charno]); printf(&#8220;%c\\n&#8221;, document[parano][sentno][wordno][charno]); charno++; you want to do: document[parano][sentno][wordno][charno++] = text[i]; By the time we hit text[i] == &#8216; &#8216; for the first time the value of ***document is &#8220;3\\n1 2\\n2\\n&#8221; but you wanted &#8230; <a title=\"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#8217;t want to cheat, can you point the problem\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/\" aria-label=\"More on [Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#8217;t want to cheat, can you point the problem\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[324,712,2162],"class_list":["post-34569","post","type-post","status-publish","format-standard","hentry","category-solved","tag-c","tag-pointers","tag-realloc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#039;t want to cheat, can you point the problem - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#039;t want to cheat, can you point the problem - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] When processing regular characters (final else clause) you read additional input instead of operating over text, i.e. instead of: scanf(&quot;%c&quot;, &amp;document[parano][sentno][wordno][charno]); printf(&quot;%cn&quot;, document[parano][sentno][wordno][charno]); charno++; you want to do: document[parano][sentno][wordno][charno++] = text[i]; By the time we hit text[i] == &#039; &#039; for the first time the value of ***document is &#8220;3n1 2n2n&#8221; but you wanted ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-30T19:29:42+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#8217;t want to cheat, can you point the problem\",\"datePublished\":\"2023-03-30T19:29:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/\"},\"wordCount\":455,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"c++\",\"pointers\",\"realloc\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/\",\"name\":\"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don't want to cheat, can you point the problem - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2023-03-30T19:29:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#8217;t want to cheat, can you point the problem\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don't want to cheat, can you point the problem - JassWeb","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:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don't want to cheat, can you point the problem - JassWeb","og_description":"[ad_1] When processing regular characters (final else clause) you read additional input instead of operating over text, i.e. instead of: scanf(\"%c\", &amp;document[parano][sentno][wordno][charno]); printf(\"%cn\", document[parano][sentno][wordno][charno]); charno++; you want to do: document[parano][sentno][wordno][charno++] = text[i]; By the time we hit text[i] == ' ' for the first time the value of ***document is &#8220;3n1 2n2n&#8221; but you wanted ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/","og_site_name":"JassWeb","article_published_time":"2023-03-30T19:29:42+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#8217;t want to cheat, can you point the problem","datePublished":"2023-03-30T19:29:42+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/"},"wordCount":455,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["c++","pointers","realloc"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/","url":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/","name":"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don't want to cheat, can you point the problem - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2023-03-30T19:29:42+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-i-have-been-on-this-question-for-quaring-the-document-for-two-days-straight-and-it-is-not-working-dont-want-to-cheat-can-you-point-the-problem\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don&#8217;t want to cheat, can you point the problem"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/34569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=34569"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/34569\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=34569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=34569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=34569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}