#include <stdio.h>
int main ()
{
int v[5];
int *z = &v[0]; // z points to v[0]
*z=12; // v[0] = 12
z++; // z points to v[1] now
*z=16; // v[1] = 16
z++; // z points to v[2] now
*z=-3; // etc
z++; // etc
*z=25; // etc
}
More Related Contents:
- What is pointer to string in C?
- What is the output of the following code in C? [closed]
- Incorrect result in c code
- whats the difference between dynamic memory allocation and normal memory allocation?
- Value changing when I pass array into function
- I need help trying to understand this piece of code about structures and pointers [closed]
- Correct format specifier to print pointer or address?
- C: differences between char pointer and array [duplicate]
- How does free know how much to free?
- “Pointer from integer/integer from pointer without a cast” issues
- Are there any platforms where pointers to different types have different sizes?
- What exactly is the array name in c?
- Does free(ptr) where ptr is NULL corrupt memory?
- How to pass a 2D array by pointer in C?
- Pointer to pointer of structs indexing out of bounds(?) when I try to index anything other than zero
- Should I use char** argv or char* argv[]?
- How to use pointer expressions to access elements of a two-dimensional array in C?
- Addresses of two char pointers to different string literals are same
- Difference between char* and const char*?
- In C, what is the correct syntax for declaring pointers?
- Pointers – Difference between Array and Pointer
- Are “malloc(sizeof(struct a *))” and “malloc(sizeof(struct a))” the same?
- C – SizeOf Pointers
- Swapping pointers in C (char, int)
- What is double star (eg. NSError **)?
- Where in memory are string literals ? stack / heap? [duplicate]
- How to include a dynamic array INSIDE a struct in C?
- How can I return a character array from a function in C?
- C difference between *[] and **
- How are we able to access the pointer after deallocating the memory?