in Education by
So my professor gave me (where x is a C executable): $ ./x y z w He said the memory size of argv in int main(int argc, char **argv) is 48 bytes, including itself. Can someone help explain this to me? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
argv is, as the function says, a pointer to a pointer to a char, which in terms of size means it's a pointer. Generally (almost always but not guaranteed?), all pointers are the same size. If this is a 64-bit machine, pointers will be 8 bytes in size. In this case, argv contains five elements: pointers to five char pointers: './x', 'y', 'z', 'w', and NULL, since argv is NULL-terminated. By my calculations, that leaves 40 bytes in argv, so I'm not sure where he's getting the other 8. Edit: As someone else suggested, argv itself would also take up room for a pointer, so there's the other 8.

Related questions

0 votes
    If page size of 1MB memory is 1 KB then the number of higher order bits of address bus used to denote page number is ( ... (c) 12 (d) 9 Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
+1 vote
    Which built-in library function can be used to re-size the allocated dynamic memory in C-Programming?...
asked Nov 9, 2020 in Technology by JackTerrance
0 votes
    In virtual memory system size of virtual address is ,32 bit, size of physical address is 30 bit, page size ... each page table entry. Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    How can you determine the size of an allocated portion of memory?...
asked Jan 23, 2021 in Technology by JackTerrance
0 votes
    Which built-in library function can be used to re-size the allocated dynamic memory?...
asked Jan 18, 2021 in Technology by JackTerrance
0 votes
    Is it possible to determine exact number of basins of attraction in energy landscape? (a) yes (b) no This ... Neural Networks of Neural Networks Please answer the above question....
asked Sep 3, 2022 in Education by JackTerrance
0 votes
    Is it possible to determine exact number of basins of attraction in energy landscape? (a) yes (b) no The ... Neural Networks of Neural Networks Please answer the above question....
asked Aug 30, 2022 in Education by JackTerrance
0 votes
    Is exact representation of pattern environment possible? (a) yes (b) no I have been asked this question in ... Neural Networks of Neural Networks Please answer the above question....
asked Aug 27, 2022 in Education by JackTerrance
0 votes
    Someone please correct me if I'm wrong, but parsing a yyyy/MM/dd (or other specific formats) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 26, 2022 in Education by JackTerrance
0 votes
    Someone please correct me if I'm wrong, but parsing a yyyy/MM/dd (or other specific formats) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 26, 2022 in Education by JackTerrance
0 votes
    I cannot find exact network performance details for different EC2 instance types on Amazon. Instead, they are ... concurrent viewers. Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    What is the exact difference between grades of organization and symmetry? Explain with examples. Select ... proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
0 votes
    What are the exact tasks for this you have used Subversion so far?...
asked Feb 17, 2021 in Technology by JackTerrance
0 votes
    Name any one command that you can execute when it comes to viewing the exact difference between the repository and the local version?...
asked Feb 17, 2021 in Technology by JackTerrance
...