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.
Loading...
Related Quiz
- The function ________ is used to write data to a binary file.
- The memory consumed by an array declared as float arr[10][20]; is ________.
- What is the purpose of the 'sizeof' operator in C?
- A pointer in C holds the ________ of a variable.
- In C, which function can be used to search for a substring within a string?