Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PP - 1 1 . 0 4 : Family - tree In order to represent the interconnected - ness of data, it is often important

PP-11.04: Family-tree
In order to represent the interconnected-ness of data, it is often important to have pointers
within a struct, either pointing to data of a different type or potentially pointing to the same
struct type. In the latter case, the syntax can be a bit awkward, as we have to create the
pointer before we have fully defined the struct itself!
Consider the following struct definition, which could be a useful way of representing a family
relationship:
Here we have defined a struct named person, that includes, as part of its definition,
pointers to other person variables representing a mother and father, respectively. With
this syntax, we have to be careful whether we are accessing a variable of the struct type or a
pointer to a variable of the struct type, as the following example illustrates:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Database And Knowledge Base Systems

Authors: S Krishna

1st Edition

9810206208, 978-9810206208

More Books

Students also viewed these Databases questions

Question

Distinguish between hearing and listening.

Answered: 1 week ago

Question

Use your voice effectively.

Answered: 1 week ago