C Interview Dangling Pointers Online Exam Quiz

C Interview Dangling Pointers GK Quiz. Question and Answers related to C Interview Dangling Pointers. MCQ (Multiple Choice Questions with answers about C Interview Dangling Pointers

The number of arguments taken as input which allocating memory dynamically using malloc() is ___________

Options

A : 0

B : 1

C : 2

D : 3

View Answer

Garbage collector frees the programmer from worrying about ___________

Options

A : Dangling pointers

B : Creating new objects

C : Memory leak

D : Segmentation errors

View Answer

Pick out the correct statement with respect to the heap.

Options

A : Local variables are stored on the heap

B : Static variables are stored on the heap

C : Heap is the data structure which is used to implement recursive function calls

D : Everything on the heap is anonymous

View Answer

When the pointer is NULL, then the function realloc is equivalent to the function ___________

Options

A : malloc

B : calloc

C : free

D : alloc

View Answer

If the space in memory allocated by malloc is not sufficient, then an allocation fails and returns ___________

Options

A : NULL pointer

B : Zero

C : Garbage value

D : The number of bytes available

View Answer

If malloc() and calloc() are not type casted, the default return type is ___________

Options

A : void*

B : void**

C : int*

D : char*

View Answer

Suppose we have a one dimensional array, named ‘x’, which contains 10 integers. Which of the following is the correct way to allocate memory dynamically to the array ‘x’ using malloc()?

Options

A : x=(int*)malloc(10);

B : x=(int*)malloc(10,sizeof(int));

C : x=malloc(int 10,sizeof(int));

D : x=(int*)malloc(10*sizeof(int));

View Answer

Chemical Engineering Basics - Part 1 more Online Exam Quiz

Casting Written Test

C Dangling Pointers

C Endianness

C General Utilities

C Inline

C Interview Date Time Function

C Interview General Utilities

C Interview Mathematical Functions

C Interview String Operations

C Library Multiple Choice