Question: 4 . ( 1 point ) Suppose that b and i are declared as follows: enum { FALSE , TRUE } b ;

4.(1 point) Suppose that b and i are declared as follows:
enum \{FALSE, TRUE\} b ;
int i;
Identify which of the following statements are legal and/or "safe' (always yield a meaningful result). Justify.
(a) b = FALSE;
(b) b = i;
(c) b++;
(d)\(\mathrm{i}=\mathrm{b}\);
(e)\(\mathrm{i}=2*\mathrm{~b}+1\);
5.(1 point) Suppose that f and p are declared as follows:
```
struct {
union {
char a b;
int c;
} d;
int e[5];
} f,*p=&f;
```
Which of the following statements are legal? Why? If not legal, correct them.
(a)\(\mathrm{p}->\mathrm{b}=\)'';
(b) p->e [3]=10;
(c)(*p).d.a ='*';
(d)\(\mathrm{p}->\mathrm{d}->\mathrm{c}=20\);
6.(1 point) The following loop is supposed to delete all nodes from a linked list and release the memory that they occupy. Unfortunately, the loop is incorrect. Explain what's wrong with it and show how to fix the bug.
```
for (p = first; p != NULL; p = p->next)
free(p);
```
4 . ( 1 point ) Suppose that b and i are declared

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!