📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    In C, which function is used to dynamically allocate

    memory?
    A malloc() Correct Answer Incorrect Answer
    B scanf() Correct Answer Incorrect Answer
    C printf() Correct Answer Incorrect Answer
    D free() Correct Answer Incorrect Answer
    E calloc() Correct Answer Incorrect Answer

    Solution

    malloc() allocates memory on the heap. calloc() is similar but also initializes memory to zero.

    Practice Next
    ask-question