You know how to pass parameters, you know how to return values -- what's left? Nothing! You're ready to use it! Calling functions in C++ is exactly the same as with Pascal, with one key difference -- if you're not passing any variables to a function when you're calling it, you still need to use the parentheses. Here's an example : int taco, warehouse; warehouse = Get_Warehouse(); taco = Get_Number_of_Tacos(warehouse); cout << "I found " << taco << " tacos in the warehouse. Yum!\n";
The above example starts by declaring two integers, ![]() |