// 2 structures tied by pointers
struct A_cust // customer information, a double-linked list with another pointer
{
char cust_info [20]; // as an example
A_cust *prevCust; // prev customer record
A_cust *nextCust; // next customer record
B_tran *point_to_B; // to the list of transaction records
};
struct B_tran // transaction records, a double-linked list with another pointer
{
char cust_tran [20]; // as an example
B_tran *prevTran; // prev customer transaction
B_tran *nextCust; // next customer transaction
A_cust *point_to_A // to the list of customer records
};
The compiler doesn’t know “B_tran” when it parses “A_cust”
If I place the definition of “B_tran” first then the compiler has no idea what “A_cust” is
Any ideas, Ernest
Add the following declaration at the top of your code
Edit: This is called a forward declaration, you’re promising the compiler that you’ll get around to defining
B_tranlater. (Thanks Greg)