answersLogoWhite

0

If you have this function:

int add(int x, int y)

{

return x + y;

}

you would pass the arguments when calling the function in the () like this:

add(4, 7);

4 & 7 would be the arguments.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Why you pass arguments to function in c plus plus?

You pass arguments to functions because that is how you tell the function what you want it to do. If you had, for instance, a function that calculated the square root of something, you would pass that something as an argument, such as a = sqrt (b). In this case sqrt is the function name, b is passed as its argument, and the return value is assigned to a.


Can you pass addresses to a function in C plus plus?

If the identifier you want to pass is an ordinary identifier, pass it as the address of... function(&identifier); If the identifier you want to pass is an array identifier, pass its name... function(arrayname);


What is meant by arguments in c?

Arguments appear in functions and in function calls. Arguments passed to a function are known as actual arguments. The arguments used by the function are known as the formal arguments. In C, all arguments are passed by value, such that the formal argument is a copy of the actual argument.


Is it possible in C plus plus builder xe to pass objects like TSQLConnection object to a dll as a parameter if yes then how?

Pass the object by reference to a function in the DLL.


What is parameters in C plus plus?

Parameters are the formal arguments of a function, as defined by the function. When you pass arguments to a function, those arguments are assigned to the function's parameters, either by value or by reference, depending on how the parameters are declared in the function. The following example explains both: void foo( int param ) { // param is a by value parameter, which is a copy of the argument passed to it. } void bar( int& param ) { // param is a reference parameter, which references the argument passed to it. } int main() { int arg = 100; foo( arg ); bar( arg ); return( 0 ); } Note that passing a pointer is the same as passing an int by value: the pointer's value is passed to the function, not the pointer itself. To pass a pointer by reference, you must pass a pointer to pointer and the function's parameter must accept a pointer to pointer.


What are the building function in c plus plus?

There is no such term as "building function" in C++.


How do you pass command line arguments using turbo in c compiler?

In the Options menu the Arguments command.


If you got a c plus and you need a c do you pass?

Yes, if you need a C to pass, and you have a C+, you pass.


What is a call by reference?

In C++ (C Plus Plus), when you call by reference, you are directly accessing the data of the referenced object. When you pass an object to a function by reference, any and all alterations to the object made within the function carry through to the actual object.


What is calling by reference?

In C++ (C Plus Plus), when you call by reference, you are directly accessing the data of the referenced object. When you pass an object to a function by reference, any and all alterations to the object made within the function carry through to the actual object.


What are the different types of function in c plus plus programming?

There are five types of functions and they are:Functions with no arguments and no return values.Functions with arguments and no return values.Functions with arguments and return values.Functions that return multiple values.Functions with no arguments and return values.Functions with no arguments and no return value.A C function without any arguments means you cannot pass data (values like int, char etc) to the called function. Similarly, function with no return type does not pass back data to the calling function. It is one of the simplest types of function in C. This type of function which does not return any value cannot be used in an expression it can be used only as independent statement.Functions with arguments and no return value.A C function with arguments can perform much better than previous function type. This type of function can accept data from calling function. In other words, you send data to the called function from calling function but you cannot send result data back to the calling function. Rather, it displays the result on the terminal. But we can control the output of function by providing various values as arguments. Functions with arguments and return value.This type of function can send arguments (data) from the calling function to the called function and wait for the result to be returned back from the called function back to the calling function. And this type of function is mostly used in programming world because it can do two way communications; it can accept data as arguments as well as can send back data as return value. The data returned by the function can be used later in our program for further calculations. Functions with no arguments but returns value.We may need a function which does not take any argument but only returns values to the calling function then this type of function is useful. The best example of this type of function is "getchar()" library function which is declared in the header file "stdio.h". We can declare a similar library function of own. Functions that return multiple values.So far, we have learned and seen that in a function, return statement was able to return only single value. That is because; a return statement can return only one value. But if we want to send back more than one value then how we could do this? We have used arguments to send values to the called function, in the same way we can also use arguments to send back information to the calling function. The arguments that are used to send back data are called Output Parameters.It is a bit difficult for novice because this type of function uses pointer


When calling a function that has multiple parameters can you list the arguments in any order?

No. C function argument are positional.

Trending Questions
How do you say 108200000 in words? How far did the pioneers typically walk each day for 6 months? What are the mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjhhhhhhhhhhhhhhhhhhhhhhhhhhhhh? Why teacher should be caring? Something that happens once a year happens annually. Something that happens every day happens daily. What is something that happens every 12 hours called? Who played in movie Casablancha? What is the code for the haunted house on poptropica? Who plays 13 year old princess bubblegum? What happens to average variable cost if the marginal cost is less than it? What is the permanently frozen area called in which most Inuit lived? Woh kia cheez ha Jo rat ko qabron pa ghumti ha din main mehlon main aajati ha mard us say dartay haan aurat usay pasand karti habachay us sa khaltay haan us pa oon or ball han nam mem sa ha? What it the least common multiple of 40 and 900? What are the release dates for Stockard Channing in Just Friends - 1979 Pilot 1-1? How did the dictatorial regimes that gained power in the years after world war 1 acquire and maintain their power? How can I effectively baby proof a bookshelf to ensure my child's safety? What are the perfect square roots between 200 and 400? How many mandals in ranga reddy district? What does honestly mean? What is the behavior in response to orders given by respected authority figures is called? What characteristics are unique to nematodes?