logo

Crowdly

Browser

Add to Chrome

Adott az alábbi függvény definíciója: int **allocateMemoryForMatrix1(int rows,...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Adott az alábbi függvény definíciója:

int **allocateMemoryForMatrix1(int rows, int cols) {

    int **matrix = (int**) calloc(rows, sizeof

(int*));

    if(!matrix)

    {

        printf("MEMORY_ALLOCATION_ERROR_MESSAGE");

        exit(-1);

    }

    for (int i = 0; i < rows; ++i) {

        matrix[i] = (int*) calloc(cols, sizeof

(int));

        if(!matrix[i])

        {

            printf("MEMORY_ALLOCATION_ERROR_MESSAGE");

            exit(-1);

        }

    }

    return matrix;

}

A függvény idő és térbeli hatékonysága:

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.ms.sapientia.ro?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome