1 AnswerNew Answer
Hi! first of all, there not such a thing "&int" as an argument or return value, this is an address access operator which returns the address of the variable. A int& return type simply means it returns a reference (address) of an EXISTING integer variable, same goes for int& as an argument, the function takes a reference to an integer instead of creating a new variable copy of it. An int* is a pointer type, it's a variable that exists in memory (in contrast to a reference which is compile-time handled) and holds an address of an int type. Whether you choose to use references or pointers or both is up to you, pointers give you more flexibility and freedom while references are simpler and save memory, but eventually they have the same purpose.