
Patrick B. answered 06/20/19
Math and computer tutor/teacher
#include <stdio.h>
//C does not have boolean type
typedef int bool;
#define true (1)
#define false (0)
//declares the structure and the pointer to it type
typedef struct _T_MY_TYPE
{
bool flag;
short int value;
double stuff;
} *T_MY_TYPE;
void init( T_MY_TYPE x)
{
x->flag=true;
x->value=15;
x->stuff = 0.123;
}
int main()
{
struct _T_MY_TYPE X;
init(&X);
int d = (X.flag)? 1:0;
printf(" %d %d %12.6lf \n",d, X.value, X.stuff);
}