Pointer size in c

broken image
broken image

The convention is C is that the declaration of a complex type looks like its use. These integers can be manipulated like any other integer in C, they appear as pointers, a family of types that can be passed as arguments, stored in variables, returned from functions, etc. In C, function parameters of array type are treated as if they had the.

broken image

(&arr + 1) simply casts the above address to an int. When the CPU wants to fetch a value from a particular location in main memory, it must supply an address: a 32-bit or 64-bit unsigned integer on typical current architectures, referring to one of up to 2 32 or 2 64 distinct 8-bit locations in the memory. size of the underlying array, but it always yields the machine pointer size. Using pointer arithmetic (&arr + 1) points to the memory address right after the end of the array. Memory in a typical modern computer is divided into two classes: a small number of registers, which live on the CPU chip and perform specialized functions like keeping track of the location of the next machine code instruction to execute or the current stack frame, and main memory, which (mostly) lives outside the CPU chip and which stores the code and data of a running program.