#mastery11

11 11 1017

Here i will teach you how to call functions in c++.

First of all you will have to create a function and put parameters in it. And put what kind it is, if it´s int, bool, void etc..

To call it you will go to your int main and write the name of your function. Here is an example.

int function (int a,int b)

{

int c;

c = a + b;

return c;

}

int main()

{

function();

}

 

So you basically just put the function number and “()” or if it has parameters “(parameters)”.

 

Hope you understand so i can have my two points!

CC BY 4.0 #mastery11 by Juan Carlos is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.