recategorized by
737 views
3 votes
3 votes

Consider the following sequence of operations:

  • Pointer p1 is set to point at a new heap-dynamic variable.
  • Pointer p2 is assigned p1’s value
  • The heap dynamic variable pointed to by p1 is explicitly de-allocated but p2 is not changed by the operation

This situation leads to which of the following:

  1. p1 becomes a dangling pointer
  2. p2 becomes a dangling pointer
  3. Both p1 and p2 are now dangling pointers
  4. Neither p1 nor p2 is now a dangling pointer
recategorized by

Please log in or register to answer this question.

Answer:

Related questions

2 votes
2 votes
1 answer
1
go_editor asked Jul 24, 2016
8,299 views
What is the output of the following program?#include<stdio.h main() { int a, b =0; static int c[10]={1, 2, 3, 4, 5, 6, 7, 8, 9, 0}; for (a=0; a<10; ++a) int ((c[a]%2)==0)...