Open links in new tab
  1. In C programming, a pointer array is a collection of pointers, each pointing to a memory location. This is particularly useful when you need to manage multiple memory locations of the same data type. The syntax for declaring a pointer array is:

    pointer_type *array_name[array_size];
    Copied!

    Here, pointer_type is the type of data the pointer points to, array_name is the name of the array, and array_size is the number of pointers in the array.

    Example: Array of Pointers to Integers

    Consider the following example where we create an array of pointers to integers:

    #include <stdio.h>

    int main() {
    int var1 = 10, var2 = 20, var3 = 30;
    int* ptr_arr[3] = { &var1, &var2, &var3 };

    for (int i = 0; i < 3; i++) {
    printf("Value of var%d: %d\tAddress: %p\n", i + 1, *ptr_arr[i], ptr_arr[i]);
    }

    return 0;
    }
    Copied!

    Output:

    Value of var1: 10 Address: 0x7fff1ac82484
    Value of var2: 20 Address: 0x7fff1ac82488
    Value of var3: 30 Address: 0x7fff1ac8248c
    Copied!

    In this example, each element of the array is a pointer pointing to an integer. We can access the value of these integers by selecting the array element and then dereferencing it.

  1. C Pointers and Arrays - W3Schools

    How Are Pointers Related to Arrays Ok, so what's the relationship between pointers and arrays? Well, in C, the name of an array, is actually a pointer to the first element of the array. Confused? …

  2. Relationship Between Pointer and Array in C - GeeksforGeeks

    Jul 23, 2025 · There are multiple syntax to pass the arrays to function in C, but no matter what syntax we use, arrays are always passed to function using pointers. This phenomenon is called …

  3. Pointers and Arrays in C - Online Tutorials Library

    In C programming, the concepts of arrays and pointers have a very important role. There is also a close association between the two. In this chapter, we will explain in detail the relationship …

  4. Arrays and Pointers - Learn C - Free Interactive C …

    By now we know that we can traverse an array using pointers. Moreover, we also know that we can dynamically allocate (contiguous) memory using blocks pointers. These two aspects can be combined to dynamically …

  5. CHAPTER 1: What is a pointer? This document is intended to introduce pointers to beginning programmers in the C programming language.

  6. C Pointers (With Examples) - Programiz

    In this tutorial, you'll learn about pointers; what pointers are, how do you use them and the common mistakes you might face when working with them with the help of examples.

  7. Pointers and Arrays in C | Free Video Tutorial | Udemy

    Pointers to arrays generally result in code that uses less memory and executes faster. So you want to use a pointer for characters as much as possible and a pointer to other data types as …

  8. How to Use Pointers with Arrays in C - Tutorial Kart

    Using pointers with arrays allows for dynamic data manipulation, iteration, and improved performance in various operations. In this tutorial, we will guide you through different ways to …

  9. C Programming/Pointers and arrays - Wikibooks

    Nov 9, 2025 · Pointers are variables that hold a memory location. There are four fundamental things you need to know about pointers: How they relate to arrays (the vast majority of arrays in …

  10. Here, arr is "decaying" into a pointer when we assign its value to arrptr. A pointer to an array points to the first element in the array. We can use pointer arithmetic or bracket notation to access the …

  11. People also ask