Think of it this way:
If a
char myChar;
declares a variable that stores a character,
int* myPtr;
declares a variable that stores the memory address.
Similarly, if
char myCharFunction();
declares a function that returns a character,
int* myPtrFunction();
declares a function that returns a memory address.
Therefore, since your function signature is int* FunctionB(int x) , it is correct when returning the memory address.
Important to understand here - int* means "memory address". And what we call a "pointer" is nothing more than a variable in which the memory address is stored. When someone says that the pointer "points to an address", they all mean that the pointer contains this address on its own (just as the char variable will contain a character).
source share