What is the meaning of 'declare a function'?
Declaring a function means that you tell the compiler 3 things 1. name of the function 2. return type of function 3. function arguments and their data type. it is done as follows: int sum(int x, int y); here we telling the compiler that the name of function is "sum", it returns integer value and accepts two arguments both of integer type.
There are two parts creating a function in C++, you need to declare it and then you need to define it. Declaring it tells the compiler the name return type and arguments, defining it tells the compiler what the function actually does. You can do these things in the same place or separately, but the function must be declared before it is called. You do not have to define it before it is called.