Elance Exams Answers PDF file

-- PDF FILE --
Download PDF file of elance Zoho Creator Exam Answers
elance-zoho-creator-exam.pdf

What is the output of the following code segment? Does it reclaims allocated memories? char *arr = (char*) malloc(10 * sizeof(char *)); for (int i = 0; i < 10; ++i) { arr[i] = (char*)malloc(10); sprintf(arr[i], "%d", i); } printf("%s", *(arr + 5)); free(arr);

5, No, there remains 10 blocks of memory, each 10 bytes, not reclaimed.
5, Yes, all the allocated memories are reclaimed.
4, Yes, all the allocated memories are reclaimed.
4, No, there remains 10 blocks of memory, each 10 bytes, not reclaimed.
5, No, there remains 9 blocks of memory, each 10 bytes, not reclaimed.
Top
  • Follows us our servcies
  • Facebook icon
  • Linkedin icon
  • twitter icon
  • rss icon
  • social icon