Both do the same, but one uses references and one uses pointers.
See my answer here for a comprehensive list of all the differences.
More Related Contents:
- What are the differences between a pointer variable and a reference variable in C++?
- When to use references vs. pointers
- When should I use the new keyword in C++?
- Pointer vs. Reference
- Why are references not reseatable in C++
- Why is ‘this’ a pointer and not a reference?
- How are references implemented internally?
- difference between a pointer and reference parameter?
- how does the ampersand(&) sign work in c++? [duplicate]
- Passing references to pointers in C++
- Difference between pointer to a reference and reference to a pointer
- What’s the meaning of * and & when applied to variable names?
- Function pointer vs Function reference
- What is the difference between std::reference_wrapper and a simple pointer?
- Why can’t I do polymorphism with normal variables?
- Why doesn’t reference-to-member exist in C++?
- Difference between const. pointer and reference?
- Confusion about pointers and references in C++
- Returning non-const reference from a const member function
- Why do some people prefer “T const&” over “const T&”?
- dereferencing a pointer when passing by reference
- Use const wherever possible in C++?
- Where ampersand “&” can be put when passing argument by reference?
- Why isn’t operator overloading for pointers allowed to work?
- C++ strings: [] vs. *
- Why is a c++ reference considered safer than a pointer?
- What is the proper way to return an object from a C++ function?
- Pass by pointer & Pass by reference [duplicate]
- Reference to a pointer
- Both asterisk and ampersand in a parameter