Storage Classes


  1. Why do we write (int *) before malloc?
    int *ip = (int *)malloc(sizeof(int));











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    It is for the type-casting


  1. Memory allocation using malloc() is done in _________











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Heap area



  1. Why do we write (int *) before malloc?
    int *ip = (int *)malloc(sizeof(int));











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    It is for the type-casting


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    char *ptr = calloc(200, 2);
    ptr = "Interview Mania";
    printf("%s\n", ptr);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Interview Mania



  1. Which of the following is used during memory deallocation in C?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    free(p);