This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/C16/alloc_example_1.c

17 lines
285 B
C
Raw Normal View History

2022-04-08 15:12:38 +00:00
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
// Declare an integer array and an integer pointer
int *pData;
// Using malloc
pData = malloc ( 10000 * sizeof (int));
// Using calloc
pData = calloc ( 10000 , sizeof (int));
return 0; // Exit
}