Home / C Programming / Memory Allocation :: Discussion

Discussion :: Memory Allocation

  1. Assume integer is 2 bytes wide. How many bytes will be allocated for the following code?

     #include 
     #include
     #define MAXROW 3
     #define MAXCOL 4  
    
     int main()
     {   
         int (*p)[MAXCOL];   
         p = (int (*) [MAXCOL])malloc(MAXROW *sizeof(*p));    
         return 0;
     } 
    

  2. A.

    56 bytes

    B.

    128 bytes

    C.

    24 bytes

    D.

    12 bytes

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment