This commit is contained in:
2026-02-03 23:15:17 +01:00
commit dcbd6de602
6 changed files with 329 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#include <stdlib.h>
#include <stdio.h>
int *division(int input, int by)
{
int value = input / by;
int *ptr = &value;
return ptr;
}
int main(void)
{
int *ptr1 = division(42, 2);
printf("the 1st value is %d\n", *ptr1);
int *ptr2 = division(12, 0);
printf("the 2nd value is %d\n", *ptr2);
free(ptr1);
free(ptr2);
return EXIT_SUCCESS;
}