 
             
            Memory Allocation - Programming
| Q1:  Point out the correct statement which correctly allocates memory dynamically for 2D array following program?
#include<stdio.h>
#include<stdlib.h>
int main()
{
    int *p, i, j;
    /* Add statement here */
    for(i=0; i<3; i++)
    {
        for(j=0; j<4; j++)
        {
            p[i*4+j] = i;
            printf('%d', p[i*4+j]);
        }
    }
    return 0;
}
A p = (int*) malloc(3, 4);
  B p = (int*) malloc(3*sizeof(int));
  C p = malloc(3*4*sizeof(int));
  D p = (int*) malloc(3*4*sizeof(int));
  ANS:A - p = (int*) malloc(3, 4); No answer description is available. Let's discuss. | 
 
             
                            
                                    For help Students Orientation 
                                    Mcqs Questions
                                
                                One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.
 
                            