answersLogoWhite

0

AllQ&AStudy Guides
Best answer

size_t for input, void * for output

This answer is:
Related answers

size_t for input, void * for output

View page

#include <stdlib.h>

int **array1 = malloc(nrows * sizeof(int *));

for(i = 0; i < nrows; i++)

array1[i] = malloc(ncolumns * sizeof(int));

View page

Nothing, malloc does allocate memory from the heap.

View page

malloc/calloc/realloc will return NULL

View page

malloc is a function of the standard c library (stdlib) and it is abbreviation for memory allocate. What this function does is allocates memory in the RAM of computer to store variable data in it. You will use it whenever you need a place to store you temporary data such as an array or structure. To use malloc all you have to do is call malloc and tell it the size of the memory you want. It will then return a pointer to that memory. persumabely if it fails it returns NULL.

View page
Featured study guide
📓
See all Study Guides
✍️
Create a Study Guide
Search results