xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to use a pointer with array in C
C Online Editor
Execute Code
More C Sample Codes
#include <stdio.h> int main() { int arr[] = {55, 12, 15, 25, 30, 80}; int *ptr = arr; // Pointer pointing to the first element of the array printf("The first element of the array: %d\n", *ptr); printf("The third element of the array: %d\n", arr[2]); *(ptr + 2) = 65; //Third element of the array modified printf("The third modifed element of the array: %d\n", arr[2]); //print second element of the array using pointer *ptr++; printf("The second element of the array: %d\n", *ptr); //print fourth element of the array using pointer printf("The fourth element of the array: %d\n", *(ptr + 3)); return 0; }