I wrote code that store value at each function call.
I want to write a function that print values. I don't know how to do it with functionCode:#include<stdio.h>
#include<stdlib.h>
int *foo ( int *P, int V)
{
int *N = malloc (sizeof(*N));
if ( N != NULL)
{
*N = V;
}
}
int main()
{
int *P = NULL;
P = foo ( P, 1);
P = foo ( P, 2);
P = foo ( P, 3);
P = foo ( P, 4);
return 0;
}