In this function declaration:
long * multiply(long ** numbers){
What do the * and ** mean? I'm somewhat of a beginner and haven't come across this before, so any explanation would be appreciated.
In this function declaration:
long * multiply(long ** numbers){
What do the * and ** mean? I'm somewhat of a beginner and haven't come across this before, so any explanation would be appreciated.
Pointer declarator: the declaration S* D; declares D as a pointer to the type determined by decl-specifier-seq S.
Further:
A pointer that points to an object represents the address of the first byte in memory occupied by the object.
long*
is a pointer to long
. long**
is a pointer to long*
.
There is more you should read about and better stay away for some time from code that has a function declaration like this:
long * multiply(long ** numbers)
It is hard to think of a realistic scenario where multiplying numbers requires you to use a long**
. Raw pointers are easy to use wrong and in modern C++ you rather only use them when you need to (which is actually quite rare).