wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Which of the following operations cannot be perform on pointers in C?

A
Addition of two pointers
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
Subtraction of a number from a pointer
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Subtraction of one pointer from another
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Addition of a number to a pointer
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A Addition of two pointers

Addition of two pointers operations cannot be perform on pointers in C.

Addition of two pointers will add two addresses and might give an address which might be so large that it is outside the range of our 32 bit or 64 bit system of addresses in contiguous memory locations. So it is not a valid operation, whereas you can add numeric values to the pointer to make it point to an address block which is that numeric value*size of (data type) number of blocks away, so adding a number to a pointer is valid, while addition of pointers is not.

Pointers in C language is a variable that stores/points the address of another variable. A pointer in C is used to allocate memory dynamically i.e. at run time. The pointer variable might be belonging to any of the data type such as int, float, char, double, short etc.


flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Solving Unknowns
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon