mirror of
https://github.com/Hizenberg469/C1-Linux_SYS_Prog-AS-.git
synced 2026-04-19 18:32:24 +03:00
Solution to Recursive Dependecies
This commit is contained in:
40
Recursive_Dependencies/A_sol.c
Normal file
40
Recursive_Dependencies/A_sol.c
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* =====================================================================================
|
||||||
|
*
|
||||||
|
* Filename: A_sol.c
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
*
|
||||||
|
* Version: 1.0
|
||||||
|
* Created: 03/02/24 10:36:54 AM IST
|
||||||
|
* Revision: none
|
||||||
|
* Compiler: gcc
|
||||||
|
*
|
||||||
|
* Author: YOUR NAME (),
|
||||||
|
* Organization:
|
||||||
|
*
|
||||||
|
* =====================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Solution to problem faced in A.c due to Recursive Dependencies*/
|
||||||
|
|
||||||
|
|
||||||
|
/**Forward Declarartion**/
|
||||||
|
struct occ_t; /**Tells the compiler that struct occ_t will be defined in future, p please tolerate if it used as pointer. It is called Forwared Declara tion**/
|
||||||
|
|
||||||
|
struct emp_t{
|
||||||
|
|
||||||
|
char name[32];
|
||||||
|
unsigned int emp_id;
|
||||||
|
struct occ_t* occ;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
struct occ_t{
|
||||||
|
|
||||||
|
char designation[32];
|
||||||
|
unsigned int salary;
|
||||||
|
struct emp_t boss;
|
||||||
|
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user