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);
}

Go back, and read the book! In any case, I don't see where you have implemented f1D1 or f1D2, etc. Also, D1 is bogus since the argument 'a' is not defined as type and it isn't used in the function, and further b and c that are used there are not really declared/defined anywhere. you may think so with the D1.c declaration, but it is not valid. As I said, go back to the text and study some more...

We dont use book. This is like part structure of the big program. We just write what ever the teacher told us to do. that why you dont see where those thing come from.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.