Examveda
Examveda

This program will allocate the memory of . . . . . . . . bytes for pointer "ptr".
#include<stdio.h>
#include<stdlib.h>
 
int main()
{
    int *ptr;
    ptr = (int*)malloc(sizeof(int)*4);
    ptr = realloc(ptr,sizeof(int)*2);
    return 0;
}

A. 2

B. 4

C. 8

D. none of the mentioned

Answer: Option C


This Question Belongs to Computer Science >> Linux

Join The Discussion

Related Questions on Linux