One common place where pointers are helpful is when you are writing functions. Functions take their arguments 'by value', which means that they get a copy of what is passed in and if a function assigns a new value to one of its arguments that will not affect the caller. This means that you couldn't write a "doubling" function like this:

void doubling(int x)
{
    x = x * 2;
}

This makes sense because otherwise what would the program do if you called doubling like this:

doubling(5);

Pointers provide a tool for solving this problem because they let you write functions that take the address of a variable, for example:

void doubling2(int *x)
{
    (*x) = (*x) * 2; 
}

The function above takes the address of an integer as its argument. The one line in the function body dereferences that address twice: on the left-hand side of the equal sign we are storing into that address and on the right-hand side we are getting the integer value from that address and then multiply it by 2. The end result is that the value found at that address is now doubled.

As an aside, when we want to call this new function we can't pass in a literal value (e.g. doubling2(5)) as it won't compile because we are not properly giving the function an address. One way to give it an address would look like this:

int a = 5;
doubling2(&a);

The end result of this would be that our variable a would contain 10.

Answer from tuckermi on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-pointers
Pointers in C - GeeksforGeeks
A pointer is declared using its data type followed by an asterisk (*) and the pointer name, indicating the type of data it can store the address of. A pointer variable stores the memory address of another variable, while the dereference operator (*) is used to access the value stored at that ...
Published: 2 weeks ago
🌐
Simplilearn
simplilearn.com › home › resources › software development › pointers in c: a one-stop solution for using c pointers
Pointers in C: A One-Stop Solution for Using C Pointers
June 23, 2025 - A pointer in C is a variable pointing to the address of another variable. Explore C Pointer's ✓ types ✓ advantages ✓ disadvantages, and more. Start learning!
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
Discussions

Why Use Pointers in C? - Stack Overflow
Find centralized, trusted content ... you use most. Learn more about Collectives ... Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... Save this question. Show activity on this post. I'm still wondering why in C you can't simply set something to be another thing using plain variables. A variable itself is a pointer to data, is ... More on stackoverflow.com
🌐 stackoverflow.com
What is the use of pointers in C?
Keep using it and you’ll quickly find out More on reddit.com
🌐 r/C_Programming
42
0
April 10, 2024
Why would anybody use pointers?
Every object in C is stored somewhere in its lifetime. As long as the object's lifetime lasts, it is guaranteed to: Exist Have a constant address Retain it's last-stored value There are times in your application, when you wish change an object's value but you want to do it outside its scope. This can mean passing a pointer to an object to a function, where the function will change the value of the original object. An example will be: void foo(int *a) { *a = 3; } void bar(int a) { a = 3; } int main(void) { int a = 2; bar(a); printf("%d\n", a); // Prints 2. foo(&a); printf("%d\n", a); // Prints 3. } bar doesn't change the value of a in main, because the a in bar is completely another object. In foo however, you are using the address of a which - while a lives - can only refer to the a in main. It is also worth noting a few things: Every object with the storage duration of allocated, can only be changed through pointers. Only automatic and static objects can have their values changed directly. u/TiagodePAlves talks about these. Their lifetime lasts from allocation (for example the library function malloc), to deallocation (for example the library function free) In all cases except when used as an operand of sizeof, the & operator or it is a string literal used to initialize an array, an array gets treated as a pointer to its first element! you probably used pointers implicitly already! EDIT: reddit formatting will never not make my life hell More on reddit.com
🌐 r/C_Programming
32
37
May 16, 2022
Should I learn pointers in C/C++ before learning pointers in Go?
If you're learning Go, I'd learn how pointers work in Go, not how they work in another language. More on reddit.com
🌐 r/golang
45
5
October 26, 2023
People also ask

What are the types of pointers in C?
There are various types of pointers. Here are a few more: · Null Pointer · Void Pointer · Wild Pointer · Near pointer · Complex pointer · Huge pointer · Far pointer · Dangling pointer
🌐
byjus.com
byjus.com › gate › pointers-in-c
Pointers in C
What is the void pointer in C?
The void pointer is also known as the generic pointer in the C language. This pointer has no standard data type, and we create it with the use of the keyword void. The void pointer is generally used for the storage of any variable’s address.
🌐
byjus.com
byjus.com › gate › pointers-in-c
Pointers in C
🌐
W3Schools
w3schools.com › c › c_pointers.php
C Pointers
They are important in C, because they allow us to manipulate the data in the computer's memory. This can reduce the code and improve the performance. If you are familiar with data structures like lists, trees and graphs, you should know that ...
🌐
freeCodeCamp
freecodecamp.org › news › pointers-in-c-programming
How to Use Pointers in C Programming
May 3, 2023 - In main(), we declare the integer ... been incremented to 43. One of the most powerful uses of pointers in C is for dynamic memory allocation....
🌐
Programiz
programiz.com › c-programming › c-pointers
C Pointers (With Examples)
You can also declare pointers in these ways. ... Let's take another example of declaring pointers. ... Here, we have declared a pointer p1 and a normal variable p2. Let's take an example. ... Here, 5 is assigned to the c variable. And, the address of c is assigned to the pc pointer. To get the value of the thing pointed by the pointers, we use the * operator.
🌐
GeeksforGeeks
geeksforgeeks.org › c++ › features-and-use-of-pointers-in-c-c
Features and Use of Pointers in C/C++ - GeeksforGeeks
June 18, 2026 - They provide an efficient way to access and manipulate memory, making them an essential feature of C and C++ programming. Provides direct access to memory locations through addresses.
Find elsewhere
Top answer
1 of 4
42

One common place where pointers are helpful is when you are writing functions. Functions take their arguments 'by value', which means that they get a copy of what is passed in and if a function assigns a new value to one of its arguments that will not affect the caller. This means that you couldn't write a "doubling" function like this:

void doubling(int x)
{
    x = x * 2;
}

This makes sense because otherwise what would the program do if you called doubling like this:

doubling(5);

Pointers provide a tool for solving this problem because they let you write functions that take the address of a variable, for example:

void doubling2(int *x)
{
    (*x) = (*x) * 2; 
}

The function above takes the address of an integer as its argument. The one line in the function body dereferences that address twice: on the left-hand side of the equal sign we are storing into that address and on the right-hand side we are getting the integer value from that address and then multiply it by 2. The end result is that the value found at that address is now doubled.

As an aside, when we want to call this new function we can't pass in a literal value (e.g. doubling2(5)) as it won't compile because we are not properly giving the function an address. One way to give it an address would look like this:

int a = 5;
doubling2(&a);

The end result of this would be that our variable a would contain 10.

2 of 4
20

A variable itself is a pointer to data

No, it is not. A variable represents an object, an lvalue. The concept of lvalue is fundamentally different from the concept of a pointer. You seem to be mixing the two.

In C it is not possible to "rebind" an lvalue to make it "point" to a different location in memory. The binding between lvalues and their memory locations is determined and fixed at compile time. It is not always 100% specific (e.g. absolute location of a local variable is not known at compile time), but it is sufficiently specific to make it non-user-adjustable at run time.

The whole idea of a pointer is that its value is generally determined at run time and can be made to point to different memory locations at run time.

🌐
BYJUS
byjus.com › gate › pointers-in-c
Pointers in C
August 1, 2022 - The pointers in C language refer to the variables that hold the addresses of different variables of similar data types. We use pointers to access the memory of the said variable and then manipulate their addresses in a program.
🌐
Reddit
reddit.com › r/c_programming › what is the use of pointers in c?
r/C_Programming on Reddit: What is the use of pointers in C?
April 10, 2024 - Pointers are just some (awesome) programming trickery that allows functions to return multiple values. Functions can return exactly one value. However, if the one value you return is a reference to some location in memory and the receiver interprets ...
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_pointers.htm
Pointers in C
C pointer is the derived data type that is used to store the address of another variable and can also be used to access and manipulate the variable's data stored at that location.
🌐
Scaler
scaler.com › home › topics › what are the uses of pointers in c?
What are the uses of pointers in c? | Scaler Topics
May 4, 2023 - The pointer size depends on the computer architecture, however, for a 32-bit system, the pointer used is 2 bytes. ... For passing the argument by using references. For accessing the elements of an array. For dynamic memory allocation by using malloc() and calloc() functions . Used in arrays, functions to improve the performance of code.
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › pointers-in-c
Pointers in C: Definition, Types, and Use Cases
July 16, 2026 - Pointers in C offer versatility ... used in different scenarios to enhance functionality, such as passing variables, managing arrays, and handling dynamic memory....
🌐
GeeksforGeeks
geeksforgeeks.org › c language › applications-of-pointers-in-c-cpp
Applications of Pointers in C - GeeksforGeeks
Pointers in C are variables that are used to store the memory address of another variable. Pointers allow us to efficiently manage the memory and hence optimize our program.
Published: July 11, 2025
🌐
Reddit
reddit.com › r/c_programming › why would anybody use pointers?
r/C_Programming on Reddit: Why would anybody use pointers?
May 16, 2022 -

Newbie here:
I know how pointers work, what do they do and how to deference them, but I don’t understand why would someone use pointers instead of the variable name. Can someone tell me what’s up?

Top answer
1 of 20
53
Every object in C is stored somewhere in its lifetime. As long as the object's lifetime lasts, it is guaranteed to: Exist Have a constant address Retain it's last-stored value There are times in your application, when you wish change an object's value but you want to do it outside its scope. This can mean passing a pointer to an object to a function, where the function will change the value of the original object. An example will be: void foo(int *a) { *a = 3; } void bar(int a) { a = 3; } int main(void) { int a = 2; bar(a); printf("%d\n", a); // Prints 2. foo(&a); printf("%d\n", a); // Prints 3. } bar doesn't change the value of a in main, because the a in bar is completely another object. In foo however, you are using the address of a which - while a lives - can only refer to the a in main. It is also worth noting a few things: Every object with the storage duration of allocated, can only be changed through pointers. Only automatic and static objects can have their values changed directly. u/TiagodePAlves talks about these. Their lifetime lasts from allocation (for example the library function malloc), to deallocation (for example the library function free) In all cases except when used as an operand of sizeof, the & operator or it is a string literal used to initialize an array, an array gets treated as a pointer to its first element! you probably used pointers implicitly already! EDIT: reddit formatting will never not make my life hell
2 of 20
25
You're probably looking at simple examples of pointers, which are not how you would typically use pointers in the real world. Here are a few examples of what you would use pointers for: Arrays where you don't know their size at compile time. Functions that need to return more than one variable. Variables or structs that need to be modified from the inside of a function call, similar to pass-by-reference in other languages. Anything that needs to have a different lifetime than the scope it was created in. Many third-party libraries will create structs or other "objects" internally and expose them by their address only, which you will then use within other function calls to that library. This type of pointer is usually called a handle.
🌐
Udemy
blog.udemy.com › home › it & development › software development › introduction to pointers in c: how to create and manage c pointers
Introduction to Pointers in C: How to Create and Manage C Pointers - Udemy Blog
April 14, 2026 - So, a piece of data might be at space “3” or space “53.” Today, the memory allocation for programs is much more complex. In C, pointers are generally used for direct memory management.
🌐
Study.com
study.com › computer science courses › computer science 111: programming in c
Pointers in C Programming: Definition, Examples & Use - Lesson | Study.com
March 13, 2023 - Pointers are special variables that store the memory address, instead of value like in usual variables. Pointers always hold addresses as a whole number. Pointers in C are always initialized to NULL.
🌐
Codeforwin
codeforwin.org › home › c program to demonstrate the use of pointers
C program to demonstrate the use of pointers - Codeforwin
July 20, 2025 - Pointers in C programming provides an efficient way to handle the low level memory activities. Like other variables, pointers also allows to declare variables of pointer types. Now, what does that mean?
🌐
freeCodeCamp
freecodecamp.org › news › pointers-in-c-are-not-as-difficult-as-you-think
Pointers in C Explained – They're Not as Difficult as You Think
August 11, 2020 - We can create an array of type struct records and use a pointer to access the elements and their members.
🌐
Medium
lorenzopiombini.medium.com › pointers-in-c-2ad210278a51
Pointers in C. a Beginner guide. | by Lorenzo Piombini | Medium
September 13, 2024 - That is why pointers are extremely powerful, you can take advantage of this in many ways, a perfect example is that, with pointers you can access data outside of a function, due to C pass by value inner working, when using functions, the parameters that you pass, are copied and they are visible only to the function, whatever happen inside the function’s body, won’t change anything at the caller level, you can do a workaround with pointers, but be careful, you will read somewhere that using pointers will change the C behavior of pass by value, that is FALSE!! C always use the pass by value
🌐
Guru99
guru99.com › home › c programming › pointers in c: what is pointer in c programming? types
Pointers in C: What is Pointer in C Programming? Types
June 30, 2026 - They provide an efficient way to access the elements of an array. They are used for dynamic memory allocation and deallocation. They are used to form complex data structures such as linked lists, graphs, and trees.