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

🌐
Codesansar
codesansar.com › home › full-menu
Benefits of Using Pointer in C Programming
November 2, 2025 - สล็อตเว็บตรง wassethiopianrestaurant.com เกมสล็อต เล่นง่าย จ่ายจริง รับวอเลท 100% ระบบ AUTO ไม่มีขั้นต่ำ ปลอดภัย เว็บสล็อต อันดับ1
Discussions

What are use cases and advantages of pointers? - Software Engineering Stack Exchange
I often struggle to see the advantages of pointers (except for low level programming). Why use of char* instead of a String or char[] or what advantages pointer arithmetic brings. More on softwareengineering.stackexchange.com
🌐 softwareengineering.stackexchange.com
What is the purpose of pointers in C/C++? What benefits do they provide?
Benefits compared to what? Pointers are needed for any piece of code that need to dynamically allocate some amount of memory (since it needs to track the location of the allocated memory which may change from one run to an other depending on how much it needs to allocate and how much has already been allocated.) An alternative is to simply never allocate memory and only use static buffers everywhere (which is unpractical for big and complex program). More on reddit.com
🌐 r/AskComputerScience
52
17
April 19, 2018
benefits of pointers in c?

what's the benefits of having a variable or value that holds 0 adress memory

0 isn't a valid memory address. If you mean "Why do you allow a pointer to hold 0 if it can then incorrectly be used to address memory"...C needed a way to indicate "invalid or unassigned pointer", and 0 was chosen because it is invalid.

Some more modern languages do distinguish between "pointers that are allowed to be invalid" and "pointers that can't be invalid".

More on reddit.com
🌐 r/learnprogramming
8
0
August 19, 2014
What's the point of pointers?
  • Since everything in C is pass by value, if you want to write a function that modifies a variable, your choices are either pass a pointer to the variable or use a global variable. Obviously the latter is to be avoided as it quickly gets messy and unmaintainable.

  • Similarly, you do not want to be copying around large data structures (e.g. structs) to pass them to functions, so you need to pass pointers for efficiency.

  • Since an array degrades to a pointer, pointers are necessary if you ever want to pass arrays to functions. And 'ragged' arrays (i.e. arrays of pointers) are the only way to pass to a function an array of 2 or more dimensions whose dimensions are not known at compile time.

  • Pointers are required for any sort of dynamic memory allocation. Any data structure whose size is not known at compile time will need to be allocated with malloc/calloc/realloc/alloca/etc, which means pointers.

  • Pointers are required to implement advanced data structures like linked lists, trees, heaps, graphs, etc.

  • Pointers to opaque struct tags provide one of the only means of data hiding/encapsulation that C provides. This means you can write a library that has data structures whose members are not exposed or visible to users, yet can still be passed to and returned from functions. For this reason it's extremely common for library APIs to deal with pointers as basic data types, such as the streams (FILE *). Or look at the pthreads API -- they all take pointers to pthread_attr_t or pthread_mutex_t or whatnot.

More on reddit.com
🌐 r/learnprogramming
33
50
July 12, 2010
🌐
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.
🌐
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.
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.

🌐
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
November 21, 2024 - The purpose of pointer is to save memory space and achieve faster execution time. If we declare a variable v of type int, v will actually store a value. ... However, each variable, apart from value, also has its address (or, simply put, where ...
🌐
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
🌐
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.
🌐
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...
🌐
Duramecho
duramecho.com › ComputerInformation › WhyCPointers.html
Why C has Pointers
There are lots more programming complications arising from C's raw pointer bodged-up strings (& the speed/memory advantage these days mainly only of interest to microcontroller & other firmware programmers) and this is a pointers article not a strings article so I'll quickly list a few more ...
🌐
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
August 10, 2017 - 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.
🌐
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.
🌐
Blogger
see-programming.blogspot.com › 2013 › 10 › advantages-and-disadvantages-of.html
Computer Programming And Technology For Dummies: Advantages and disadvantages of pointers in c
The text provides a clear overview of pointers in C, highlighting both their advantages and disadvantages. Pointers offer powerful capabilities like direct memory access, dynamic memory management, and efficient data handling, which are essential for building complex data structures.
🌐
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...
🌐
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
🌐
W3Schools
w3schools.in › cplusplus-tutorial › pointers
Pointers in C++
Pointers can allocate memory dynamically, where programmers don't have to worry about how much memory they will need to assign for each task, which cannot be done/performed without the concept of a pointer.
🌐
Fresh2Refresh
fresh2refresh.com › home › c++ tutorial › c++ pointers
C++ pointers | Learn C++ Online | Fresh2Refresh.com
September 23, 2020 - Pointers are used to refer directly to the value it points to. It has different properties on the basis of the pointer points to different data types like when it points to char, int or float.
🌐
Xspdf
xspdf.com › resolution › 10253509.html
Professional .NET SDK to create, edit, save PDF and Excel, convert ...
Provide encoding and creating populoar symbologies of barcodes, and insert barcode image to PDF.