Questions tagged [inheritance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
54 views

pset5 ; inheritance ; memory leakage

I have successfully completed the inheritance.c script, but there is something I do not understand, if anyone would be willing to help. inside free_family function, when handling the base case: if (p-&...
0
votes
1answer
73 views

how does recursion reach parent[1] in inheritance?

A similar question was asked previously about "when" the recursion happens in inheritance and I'm struggling to wrap my head around it. How does the program ever reach parent[1] if create ...
1
vote
1answer
110 views

When does a recursive function actually repeat?

I was just wondering when exactly a recursive function repeats itself. Below is code from inheritance.c from CS50's Lab 5: person *create_family(int generations) { // TODO: Allocate memory for new ...
0
votes
1answer
109 views

Lab 5 Check50 Error Question

When I run Check50 I get an error. I have watched the hint video and my code matches what is shown. I have attached a screenshot of my error as well as the code below. Thank you for the help! person *...
1
vote
2answers
703 views

Segmentation Fault on Inheritance, Lab 5

I tried lab4 but I was having issues so I watched Brian's solution walkthrough. The code compiles and all goes well but when I run the program it shows a segmentation fault. debug50 shows a segfault ...
0
votes
1answer
30 views

stdbool.h in lab5 inheritance

Does anyone know the reason for including (stdloob.h) in lab5 ? what is the importance of this header file in the code ? I already check it without including this file and it was ok.