One benefit of pointers is when you use them in function arguments, you don't need to copy large chunks of memory around, and you can also change the state by dereferencing the pointer.

For example, you may have a huge struct MyStruct, and you have a function a().

void a (struct MyStruct* b) {
   // You didn't copy the whole `b` around, just passed a pointer.
}
Answer from alex on Stack Overflow
Top answer
1 of 11
14

One benefit of pointers is when you use them in function arguments, you don't need to copy large chunks of memory around, and you can also change the state by dereferencing the pointer.

For example, you may have a huge struct MyStruct, and you have a function a().

void a (struct MyStruct* b) {
   // You didn't copy the whole `b` around, just passed a pointer.
}
2 of 11
8

Coming from Java, you'll have a slightly different perspective than what is presented in K&R (K&R doesn't assume that the reader knows any other modern programming language).

A pointer in C is like a slightly more capable version of a reference in Java. You can see this similarity through the Java exception named NullPointerException. One important aspect of pointers in C is that you can change what they point to by increment and decrement.

In C, you can store a bunch of things in memory in an array, and you know that they are sitting side by side each other in memory. If you have a pointer to one of them, you can make that pointer point to the "next" one by incrementing it. For example:

int a[5];

int *p = a; // make p point to a[0]
for (int i = 0; i < 5; i++) {
    printf("element %d is %d\n", i, *p);
    p++; // make `p` point to the next element
}

The above code uses the pointer p to point to each successive element in the array a in sequence, and prints them out.

(Note: The above code is an expository example only, and you wouldn't usually write a simple loop that way. It would be easier to access the elements of the array as a[i], and not use a pointer there.)

🌐
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
🌐
Blogger
programmertutor16.blogspot.com › 2013 › 10 › advantages-and-disadvantages-of.html
Advantages and disadvantages of pointers in c - PROGRAMMER TUTORIAL
Pointers can be used to pass information back and forth between the calling function and called function. Pointers allows us to perform dynamic memory allocation and deallocation. Pointers helps us to build complex data structures like linked list, stack, queues, trees, graphs etc.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › c-pointers
Pointers in C - GeeksforGeeks
A pointer is a variable that stores the memory address of another variable. Instead of holding a direct value, it holds the address where the value is stored in memory. It is the backbone of low-level memory manipulation in C.
Published   December 15, 2016
🌐
GeeksforGeeks
geeksforgeeks.org › c++ › features-and-use-of-pointers-in-c-c
Features and Use of Pointers in C/C++ - GeeksforGeeks
July 28, 2025 - An array, of any type, can be accessed with the help of pointers, without considering its subscript range. Pointers are used for file handling. Pointers are used to allocate memory dynamically.
🌐
Dotnet Tutorial
dotnetustad.com › c-programming › pointer-advantages-and-disadvantages
Pointer Advantages and Disadvantages
While pointers are powerful and essential in C and C++ programming, they should be used with caution, following best practices, and thorough testing to minimize associated risks
🌐
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
49
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
24
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.
Find elsewhere
🌐
UK Academe
ukacademe.com › QuestionsBank › CProgramming › Pointer_And_There_Advantage
Pointer And There Advantage | C Programming | Questions Bank | UK Academe
Using pointer arrays to store character strings, saves data storage space in memory. Pointers allow C to support dynamic memory management. Pointers reduce length and complexity of programs.
🌐
E Computer Notes
ecomputernotes.com › home › pointer › advantages of using pointers in c
Advantages of using pointers in C - Computer Notes
August 31, 2020 - (iii) Pointers enhance the execution speed of a program. (iv) Pointers are helpful in traversing through arrays and character strings.
🌐
Sankalandtech
sankalandtech.com › Tutorials › C › pros-pointer-c.html
advantage or pros of pointer in c language.
Advantage or pros of pointer Efficient memory management, Flexibility, Enhanced performance,Pass by reference, Data structures
🌐
Quora
quora.com › What-are-the-benefits-of-using-pointers-in-C-programming-Does-using-pointers-make-your-program-run-faster
What are the benefits of using pointers in C programming? Does using pointers make your program run faster? - Quora
Answer (1 of 2): There are a number of benefits. For me, these are the big two: 1. Passing a parameter by pointer to a function allows the function to permanently alter that parameter’s value. 2. Passing a parameter by pointer to a function prevents the compiler from having to copy that ...
🌐
Ques10
ques10.com › p › 68382 › what-is-pointer-explain-its-advantages-and-disad-1
What is Pointer? Explain its advantages and disadvantages of it
Pointer reduces the execution of the program. ... Pointer are slower than normal variables. Uninitialized pointer might cause segmentation fault. Dynamically allocated block needs to be freed explicity. Otherwise, it would lead to memory task. If pointer bugs are updated with incorrect values, ...
Top answer
1 of 8
6

Pointers are necessary for dynamic memory location, many data structures, and efficient handling of large amounts of data. Without pointers, you'd have to allocate all the program data globally or in functions or the equivalent, and you'd have no recourse if the amount of data grew beyond what you had originally allowed for. I hesitate to use absolutes here, but as far as I know all modern computer languages have pointers in some form or other.

In most languages that use pointers, there are certain sorts of references that are pointers, and perhaps certain sorts of references that aren't, and there is no further notational difference. A Lisp cons cell is a pair of pointers, although a fixnum is not a pointer. In Java, the variable used for the instance of a class is a pointer, but an int isn't. The language syntax doesn't reflect that.

C is unusual in that pointers are optional, explicit, and allow explicit pointer arithmetic. It is perfectly possible to write struct foo bar; struct foo * baz;, and once you've allocated memory for baz you can use both bar and baz to represent struct foos. Since pointers are optional, it is useful to have notational differences. (It's essential in C++ for smart pointers, as given boost::shared_ptr<foo> bar;, bar.reset() has one meaning and bar->reset() is likely to have a much different one.)

(Actually, explicit pointers were often used in other languages when C was originally being developed, such as ^ in Pascal. C is an older language than most in common use today, and it shows.)

One of C's design goals was to write Unix in, and therefore it needed to handle memory locations in a detailed manner. (C is actually one of a family of system implementation languages common when it was being designed, another example being Cybol for Control Data computers. C is the one that became a big hit.) Therefore, it is possible to manipulate C pointers directly, assigning memory addresses and calculating new ones. This also led to some design decisions in C. C arrays are based heavily on pointer arithmetic, and indeed an array decays into a pointer in very many situations. Passing variables to C functions by reference is done by pointer. There was no strong need for arrays and passing variables by reference in the form that other contemporary languages had, so C didn't get those.

So, the answer is that, in most languages nowadays, you use pointers constantly without being reminded of the fact. In C, and to a lesser extent C++, you use pointers either to do low-level things, or as accomplish higher-level things that there's no special notation for.

2 of 8
10

Complex data structures. You can't build something like a linked list or a binary tree without pointers.

There are no "pros" and "cons" of pointers. They are just a tool, like a hammer.

🌐
Quora
quora.com › What-are-the-advantages-and-disadvantages-of-using-pointers-in-C-programming-language
What are the advantages and disadvantages of using pointers in C programming language? - Quora
Answer: CPUs uses memory address and C pointers are memory addresses with compile-time checking to catch mistakes like setting a pointer intended for one type of object pointing to a different type of object. As already mentioned, data structures like lists, trees, maps, etc require pointers. Al...
🌐
LogicMojo
logicmojo.com › pointer-in-C
Pointer in C- Logicmojo
- Sorting and searching can be performed based on the criteria defined by the pointers. ... - Instead of storing the actual data in the array, you store memory addresses, which usually require fewer bytes.
🌐
CloudThat
cloudthat.com › home › blogs › the power of pointers in c programming
The Power of Pointers in C Programming
June 25, 2024 - Pointers are necessary for dynamic memory allocation, enabling library functions like malloc, calloc, and realloc to allocate memory at runtime. A variable that holds the address of another pointer is called a pointer to a pointer.
🌐
Quizgecko
quizgecko.com › discover › science › computer science › advantages of pointers
Advantages of Pointers in C Programming: Quiz and Flashcards
Pointers provide direct access to memory, reducing complexity and length of a program, and improving execution speed.
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › pointers-in-c
Pointers in C: Definition, Types, and Use Cases
Pointers in C are variables that store memory addresses, allowing for dynamic memory management, efficient array handling, and direct manipulation of data.