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.)

๐ŸŒ
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 ย  November 14, 2025
๐ŸŒ
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.
๐ŸŒ
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
50
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.
๐ŸŒ
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.
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.

๐ŸŒ
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
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.
๐ŸŒ
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 paramete...
๐ŸŒ
Quora
quora.com โ€บ What-are-the-advantages-of-a-pointer-in-the-C-programming-language
What are the advantages of a pointer in the C programming language? - Quora
Answer (1 of 7): 1.To allocate memory dynamically. 2.To pass array or string more efficiency. 3.To return more than one value from function. 4.To built complex data structure.
๐ŸŒ
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.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ c language โ€บ applications-of-pointers-in-c-cpp
Applications of Pointers in C - GeeksforGeeks
The functions in C can only return a single value, but we can use pointers to return multiple values from a C function. ... The below example demonstrates the use of pointers to return square and square root of numbers using pointers.
Published ย  July 11, 2025
๐ŸŒ
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, ...
๐ŸŒ
Reddit
reddit.com โ€บ r/askcomputerscience โ€บ what is the purpose of pointers in c/c++? what benefits do they provide?
r/AskComputerScience on Reddit: What is the purpose of pointers in C/C++? What benefits do they provide?
April 22, 2018 - In C,you have an operator that gives you access to the address of a variable,it's &. It can be usefully, as an exemple,in order to improve performances. Basically,you would prefer pass as a parameter to a function a pointer (which is 8 bytes long) instead of a struct typed variable that would contains 3 double which would be 24 bytes long.
๐ŸŒ
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
Without pointers, it would be extremely cumbersome to deal with character strings. Without pointers, you could not use a great many standard library functions, as they return pointers and/or take them as argument...
๐ŸŒ
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.
๐ŸŒ
Pskills
pskills.org โ€บ cinterview1.jsp
What are the advantages of using pointers in a program?
Major advantages of pointers are: (i) It allows management of structures which are allocated memory dynamically. (ii) It allows passing of arrays a...
๐ŸŒ
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