Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f68782021b |
@@ -1,28 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int *division(int input, int by)
|
||||
{
|
||||
|
||||
//int value = input / by;
|
||||
if (by != 0){
|
||||
//int value = input / by;
|
||||
}
|
||||
else
|
||||
return
|
||||
|
||||
//int value = 0;
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user