I give up:
Code:
#include <stdio.h>
typedef struct
{
int inst;
} Dip;
int func(Dip *req)
{
int response;
if (req->inst == 0)
{
response = 0;
}
else
{
response = 1;
}
return response;
}
int main(void)
{
int result;
Dip req;
req.inst = 1;
result = func(&req);
printf("inst=%d; result=%d\n", req.inst, result);
req.inst = 0;
result = func(&req);
printf("inst=%d; result=%d\n", req.inst, result);
return 0;
}
If you are smart, you will do your best to actually understand this, comparing it to your own attempts, instead of just getting spoonfed.