What happens when you perform pointer arithmetic on a pointer to a data type other than 'char'?

  • It generates a compilation error
  • It increments the pointer by one byte
  • It results in undefined behavior
  • It returns the size of the data type in bytes
When you perform pointer arithmetic on a pointer to a data type other than 'char,' it results in undefined behavior. This is because the pointer arithmetic depends on the size of the data type, and it may lead to accessing memory incorrectly.
Add your answer
Loading...

Leave a comment

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