accessing elements of 1d array using pointers
#include<stdio.h>
int main(){
int arr[] = {1,3,4,5,6,7,8};
int *ptr = &arr; //storing address of the first element in array in the ptr
//accessing the elements of the array using ptr
for(int i=0;i<7;i++)
printf("%d ",*(ptr+i));
//here i represents the value to be added to the base address
return 0;
}
Also in C:
- change plot line color in matplotlib
- c unused variable
- vbl share price
- how to define a enum in c
- how to go to top of file in vim
- leer un archivo en c
- convert list of strings to string
- read from stdin c
- passing 2d array as parameter to function in c
- putting value of struct in runtme
- open a file in from terminal
- program to concatenate two strings in c
- matplotlib pyplot legend location
- how can i show ant text by onclick
- how to set params from @get from retrofit
- pointer offset notation
- buscar caracter
- TBufDataset
- how to change the mapping from jkil to wasd in vim
- c value set to zero __memmove_avx_unaligned_erms
- powershell list big files
- comment c
- srand() C
- djb2 algorithm for C