Computer Science, asked by indhu4687, 21 days ago


Here, in main(), pointer 'p' becomes dangling pointer. How can it prints correct value all the time?Dangling pointer gives undefined results right?

But the same program like before, here I just removed for loop. But, dangling pointer 'p' prints 1 time correctly and gives garbage value. And also, that increment() block is deleted. But, when I gave *p=10, how come it prints even 1 time correctly?

In the above all programs, I am just trying to know what happens if I print dangling pointer. And life time and scope of pointer variable. But, here it's giving weird results apart from what I learnt.

Attachments:

Answers

Answered by piyushkumar2231
0

Answer:

Mama bear brought honey for baby bear.

4. I can make tea.

5. Alice went to Wonderland.

6. We like to read books.

7. Pinku broke my doll yesterday.

8. Ants collect food for winter.

9. Harry Potter defeated the evil wizard.

10.A dragon was guarding the treasure.

Q2 Match the subjects to their predicates to form complete

sentences.

Subject Predicate

1. A camel a. fell and hurt herself.

2. Dogs b. makes houses of bricks.

3. Fish c. is a big city.

4. The girl d. are faithful animals.

5. A mason e. swim in water.

6. Mumbai f. has a bump on its back.

7. The doctor g. loves to eat pizza.

8. Deepak h. is a skilled carpenter.

9. The park i. treated me wit

Similar questions