move exercises, lecture examples, labs into subfolders
This commit is contained in:
17
Exercises/C16/alloc_example_1.c
Normal file
17
Exercises/C16/alloc_example_1.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#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
|
||||
}
|
||||
Reference in New Issue
Block a user