Not exactly what you're asking, but addressing an incorrect assumption: To deal with arrays use std::vector, or in the case of a fixed size array, std::array. They can returned by functions. Answer from alfps on reddit.com
๐ŸŒ
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 :- A pointer is a variable that stores the address of another variable. Unlike other variables that helds values of a certain type, pointer holds the address of a variables .
๐ŸŒ
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.
๐ŸŒ
Blogger
programmertutor16.blogspot.com โ€บ 2013 โ€บ 10 โ€บ advantages-and-disadvantages-of.html
Advantages and disadvantages of pointers in c - PROGRAMMER TUTORIAL
Benefits(use) of pointers in c: Pointers provide direct access to memory Pointers provide a way to return more than one value to the functio...
๐ŸŒ
Reddit
reddit.com โ€บ r/cpp_questions โ€บ what advantages/disadvantages do pointers/references have?
r/cpp_questions on Reddit: What advantages/disadvantages do pointers/references have?
May 3, 2019 -

I see a lot of people using pointers/references instead of a actual variable. I know that pointers are variables that store the memory location of a already existing variable and that references are not stored in memory because they "reference" to a variable (and because of that, it can't change to what it references on later).

I can think only 2 cases where pointers/references are useful:

  • Because I can't return an array, when I want to return one, I can return a reference to it.

  • To avoid variable-duplication.

Apart from this, I can't think why should I want to use them.

Did I understand something wrong?

๐ŸŒ
Filo
askfilo.com โ€บ cbse โ€บ smart solutions โ€บ what are the advantages and disadvantages of using pointers? d
What are the advantages and disadvantages of using pointers? Differentia..
December 19, 2025 - For example, if an int pointer points to an int at address 1000, incrementing it will make it point to address 1004 (assuming 4 bytes for int). ... Pointer arithmetic is useful for traversing arrays and dynamic memory. ... These categories help ...
๐ŸŒ
UKEssays
ukessays.com โ€บ home โ€บ advantages and disadvantages of using a pointer computer science essay
Advantages And Disadvantages Of Using A Pointer Computer Science Essay | UKEssays.com
When setting up data ststructures ... the pointer to be manipulated as a memory address.Because pointers allow largely unprotected access to memory addresses....
๐ŸŒ
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...
๐ŸŒ
O'Reilly
oreilly.com โ€บ library โ€บ view โ€บ object-oriented-programming โ€บ 9789332503663 โ€บ xhtml โ€บ head-0593.xhtml
12.13 - Advantages and Disadvantages of Pointers - Object Oriented Programming with C++, Second Edition [Book]
May 15, 2012 - Please note the following points. Dangling pointers, mostly, create difficult to diagnose errors. Pointers lead to memory leaks. For parameter passing with reference, in C language using pointers were compulsory.
Authors ย  Mahesh BhaveSunil Patekar
Published ย  2012
Pages ย  679
Find elsewhere
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.)

๐ŸŒ
Tutorialtpoint
tutorialtpoint.net โ€บ 2021 โ€บ 06 โ€บ advantages-and-disadvantages-of-pointers-in-c.html
Advantages and disadvantages of pointers in C ~ TUTORIALTPOINT- Java Tutorial, C Tutorial, DBMS Tutorial
Advantages of pointers: Pointers are more efficient in handling arrays and data tables. Pointers permit references to functions and there by facilitating passing of function as arguments to other functions.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ c++ โ€บ features-and-use-of-pointers-in-c-c
Features and Use of Pointers in C/C++ - GeeksforGeeks
July 28, 2025 - Pointers are used with data structures. They are useful for representing two-dimensional and multi-dimensional arrays. An array, of any type, can be accessed with the help of pointers, without considering its subscript range.
๐ŸŒ
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
๐ŸŒ
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.
๐ŸŒ
Unstop
unstop.com โ€บ home โ€บ blog โ€บ pointers in c | ultimate guide with easy explanations (+code)
Pointers In C | Ultimate Guide With Easy Explanations (+Code)
March 21, 2024 - Mastery of pointers is crucial for any C programmer, as they allow for efficient memory management, dynamic data structures, and low-level access to system resources. Understanding pointers allows us to perform low-level memory access, dynamic ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ c language โ€บ c-pointers
Pointers in C - GeeksforGeeks
Pointers are used to form complex data structures such as linked lists, graphs, trees, etc. Pointers reduce the length of the program and its execution time as well. Pointers are vulnerable to errors and have following disadvantages:
Published ย  November 14, 2025
๐ŸŒ
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.
๐ŸŒ
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