Hello There, Can I someone explain this problem. I dont understand what mean. I have read over and over i still dont get it.
Assume you need an application that operates on two kinds of data types D1 and D2. Both D1 and D2 need to be defined with typedef.
Assume you need some functions to operate on the data (assuming the C langauge): f1D1() and f2D1() operating on D1 and f1D2() operating on D2.
Assume a helper function fhD1() and helper integer intD1 to help the functions operating on D1 (not available to others).
Assume global data g1 and g2 of some built in type.
Assume the main created a variable of type D1 and then operates on it. D2 is not needed in main, but it is needed in f1D2().
Given this, and disregarding other details, design all files needed. Use inclusion-prevention. For each file you have, show important elements, disregarding other details. Submit as actual files with the actual names.
Here is what I have try.
#typedef D1
#typedef D2
Main.c
void main
{
D1 (a);
}
D1.c
void D1 (a)
{
f1D1 (c);
f1D2(b);
}
D2.c
void D2(z)
{
fiD2 (x);
}
fhD1.c
viod fhD1 (p)
{
int D1 (p);
}