It depends on the return value of the function.
If this is void
the function does not have a return value and you do the first.
callOne(1, 2);
If it has something else like int
, char
or std::string
you can use the first but also the second.
callTwo = func2(5, 9);
In this case you save the value the function returns in the variable.
If you use the first variant on a function with return value (not void
) the result will be ignored.
I would advice you to google for some basic tutorials like this or this for example. You won’t be very fast if you let SO teach you basic things.
2
solved Best way to call a function C++ [closed]