If Else

POINTER

  1. What is Pointer?
  2. See Answer Ans: A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before using it to store any variable address.

  3. What is indirection operator?
  4. See Answer Ans: The indirection operator is a unary operator represented by the symbol (*). The indirection operator can be used in a pointer to a pointer to an integer, a single-dimensional array of pointers to integers, a pointer to a char, and a pointer to an unknown type.

  5. What is void Pointer?
  6. See Answer Ans: The void pointer, also known as the generic pointer, is a special type of pointer that can be pointed at objects of any data type! A void pointer is declared like a normal pointer, using the void keyword as the pointer's type: 1. void *ptr; // ptr is a void pointer

  7. How to declare a Pointer Variable?
  8. See Answer Ans: datatype * variable_name;
    eg. int *p;

  9. Is it possible to store address of int variable in float pointer?
  10. See Answer Ans:

  11. What is size of pointer variable of int type?
  12. See Answer Ans:

  13. What is size of pointer variable of char type?
  14. See Answer Ans:

  15. Is it possible to change the address of any variable?
  16. See Answer Ans:

  17. What is Generic Pointer?
  18. See Answer Ans: When a variable is declared as being a pointer to type void it is known as a generic pointer. Since you cannot have a variable of type void, the pointer will not point to any data and therefore cannot be dereferenced. It is still a pointer though, to use it you just have to cast it to another kind of pointer first.

  19. Explain pointer to pointer.
  20. See Answer Ans:

  21. What is pointer to array?
  22. See Answer Ans:

  23. When to use pointer to array?
  24. See Answer Ans:

  25. Is array variable a pointer variable?
  26. See Answer Ans:

  27. Does array variable contain base address of array?
  28. See Answer Ans:

  29. If the address of one location of float array is 112 then what will be the address of 2nd location?
  30. See Answer Ans:

  31. What is array of pointer?
  32. See Answer Ans:

  33. What is self refrential structure?
  34. See Answer Ans:

  35. What will be the output of?
    • int x=7;
      printf("%d",*&x&x);
      See Answer Ans: