answersLogoWhite

0

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

Updated: 8/20/2019
User Avatar

Wiki User

12y ago

Best Answer

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);

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you pass addresses to a function in C plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you do a pass by reference in C with explanation?

Not possible, but you can still pass addresses.


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.


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.


How will you pass arguments to a function in c plus plus?

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.


What are the building function in c plus plus?

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


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 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 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.


A c plus plus statement that invokes a function is known as?

...a function call.


Can a variable name can be passed to a value parameter in c plus plus?

No. Pass by value always receives a copy of the value being passed. Even if it were possible to physically pass a user-defined identifier into a function by value, the compiled code would not recognise the name since all identifiers are stripped out by the compiler and replaced with memory addresses. Strictly speaking, even pass by reference does not pass the variable name, as the function argument is simply an alias, an alternate but informal name, for the formal name you actually pass. In essence you are passing the memory address of the variable, rather the value of the memory address as you would with pass by value.


When will you make a function inline in c plus plus?

yes,we can make function inline


What is the only function all C plus plus programs must contain?

Every C plus plus program that is a main program must have the function 'main'.