What is the result of adding an integer to a pointer?

  • It causes a compilation error.
  • It increments the integer.
  • It increments the pointer.
  • It multiplies the integer.
Adding an integer to a pointer in C increments the pointer by the product of the integer and the size of the data type pointed to. It does not increment the integer itself. If the result is outside the valid memory range, it can lead to undefined behavior.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *