move exercises, lecture examples, labs into subfolders

This commit is contained in:
2023-10-13 16:19:51 +01:00
parent a602f20e01
commit 015b5d6a08
200 changed files with 2 additions and 2 deletions

23
Exercises/C16/ex3.c Normal file
View File

@@ -0,0 +1,23 @@
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
// Declare an integer array and an integer pointer
int *pData;
int datlen;
printf("Length of data to be allocated: ");
scanf("%d", &datlen);
// Using malloc
pData = malloc ( datlen * sizeof (int));
for (int i = 0; i < datlen; i++) {
pData[i] = i;
printf("%d %d\n", i, i);
}
free(pData);
return 0; // Exit
}