download Mastguru Android App

Question Detail

What is dangling pointer in c

  • if pointer is pointing to a memory location from where variable has been deleted
  • if pointer is assigned to more than one variable
  • if pointer is not defined properly
  • none of above
Similar Questions :

1. Disadvantage of array in C is

  • We can easily access each element
  • It is necessary to declare too many variables
  • It can store only one similar type of data
  • None of above

2. Adding to a pointer that points to an array will

  • Cause an error
  • Increase the value of the element that the pointer is pointing to
  • Cause the pointer to point to the next element in the array
  • None of above

3. What will be the output of following program
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(\"%d\",x);
}

  • error
  • 0
  • 10
  • Garbage value

4. A variable in c

  • must have a valid datatype
  • can't have a name same as keyword
  • must have a name starting with a character
  • All of above

5. What is prototype of a function in C

  • It is the return type of a function
  • It is the return data of the function
  • It is declaration of a function
  • It is a datatype
Read more from - C Programming Questions Answers - Chapter 1
Post a comment