Top "Pointer-arithmetic" questions

You can perform a limited number of arithmetic operations on pointers.

Pointer arithmetic for void pointer in C

When a pointer to a particular type (say int, char, float, ..) is incremented, its value is increased by the size …

c pointers void-pointers pointer-arithmetic
With arrays, why is it the case that a[5] == 5[a]?

As Joel points out in Stack Overflow podcast #34, in C Programming Language (aka: K & R), there is mention of …

c arrays pointers pointer-arithmetic
Pointer Arithmetic

Does anyone have any good articles or explanations (blogs, examples) for pointer arithmetic? Figure the audience is a bunch of …

c pointers pointer-arithmetic
Using void pointer to an array

I was just trying to use a void pointer to an integer array ,I tried to see if i can …

c pointers void-pointers pointer-arithmetic
Pointer arithmetic for structs

Given a struct definition that contains one double and three int variables (4 variables in all), if p is a pointer …

c pointers struct pointer-arithmetic
warning: pointer of type ‘void *’ used in arithmetic

I am writing and reading registers from a memory map, like this: //READ return *((volatile uint32_t *) ( map + offset )); //WRITE *((…

c++ pointers void-pointers pointer-arithmetic
Portable and safe way to add byte offset to any pointer

I'm quite new at working with C++ and haven't grasped all the intricacies and subtleties of the language. What is …

c++ pointers c++11 pointer-arithmetic
Pointer/Address difference

Why is the difference between the two addresses wrong? http://codepad.org/NGDqFWjJ #include<stdio.h> int main() { …

c pointers pointer-arithmetic
C/C++: Pointer Arithmetic

I was reading a bit in Pointer Arithmetic, and I came upon 2 things I couldn't understand neither know it's use …

c++ c pointers math pointer-arithmetic
Order of operations for dereference and bracket-ref in C

If I do *ptr[x], is that equivalent to *(ptr[x]), or (*ptr)[x]?

c pointers pointer-arithmetic