ExamVeda
Login
Home
31
The number of arguments for realloc() function is/are:
Discuss
Answer & Solution
Answer: Option C
Solution:

As it takes two parameters, one is the pointer to the existing block and the second is the value for new size in integers.

32
With every use of a memory allocation function, what function should be used to release allocated memory, which is no longer needed?
Discuss
Answer & Solution
Answer: Option E
No explanation is given for this question. Let's Discuss on Board
33
Array is preferred over linked list for the implementation of . . . . . . . .
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
34
The free() function frees the memory state pointed to by a pointer and returns . . . . . . . .
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
35
When the pointer is NULL, then the function realloc is equivalent to the function . . . . . . . .
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
36
What will be the output of the following C code if the input entered as first and second number is 5 and 6 respectively?
#include<stdio.h>
#include<stdlib.h>
main()
{
    int *p;
    p=(int*)calloc(3*sizeof(int));
    printf("Enter first number\n");
    scanf("%d",p);
    printf("Enter second number\n");
    scanf("%d",p+2);
    printf("%d%d",*p,*(p+2));
    free(p);
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
37
What will be the output of the following C code?
#include<stdio.h>
#include<stdlib.h>
void main()
{
    char *p = calloc(100, 1);
    p = "welcome";
    printf("%s\n", p);
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
38
Which of the following is an example for non linear data type?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
39
Local variables are stored in an area called . . . . . . . .
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
40
If the space in memory allocated by malloc is not sufficient, then an allocation fails and returns . . . . . . . .
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board