Can you add pointers together? Why would you? Ans. No, you can't add pointers together. If you live at 1332 Lakeview Drive, and your neighbor lives at 1364 Lakeview, what's 1332 1364? It's a number, but it doesn't mean anything. If you try to perform this type of calculation with pointers in a C program, your compiler will complain. The only time the addition of pointers might come up is if you try to add a pointer and the difference of two pointers: p = p p2 - p1; which is the same thing as this: p = (p p2) - p1. Here's a correct way of saying this: p = p ( p2 - p1 ); Or even better in this case would be this example: p = p2 - p1; - Study24x7
Social learning Network
06 Apr 2023 11:43 AM study24x7 study24x7

Can you add pointers together? Why would you? Ans. No, you can't add pointers together. If you live at 1332 Lakeview Drive, and your neighbor lives at 1364 Lakeview, what's 1332+1364? It's a number, but it doesn't mean anything. If you try to perform this type of calculation wit...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles