taeyounkim LOG
pointer practice 4 (function to print bigger integer) 본문
Career&Study/Coding Practice
pointer practice 4 (function to print bigger integer)
taeyounkim 2021. 7. 8. 23:04728x90
#include <stdio.h>
int *max(int *, int *);
int main()
{
int *p, i=1, j=3;
p = max(&i, &j);
printf("%d\n", *p);
return 0;
}
int *max(int *a, int *b)
{
if(*a > *b)
return a;
else
return b;
}
728x90