answersLogoWhite

0


Best Answer

Yes, passing a variable by reference gives you a pointer to the original variable, meaning you can change its value from within the function being called and the change will affect the original variable.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is it true that passing data by reference enables you to change the value stored in a variable in one file using a function in another file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Which function enables to receive single character input?

getchar();


What enables us to use a function that has been declared and defined in source code?

If the function has been declared and defined, then the only remaining issue is scope, i.e. visibility.


What is a graphic representation that is often a small image on a button that enables you to run a program or program function?

Icon


What is difference between call by value and pass by value?

When you pass by value, the function's parameter is assigned the value of the argument that was passed. When you pass by reference, the function's reference parameter is assigned the address of the argument. In other words, pass by value copies the value, pass by reference passes the variable itself.Pass by reference is always the preferred method of passing arguments to functions when those arguments are complex objects. If the argument is a primitive data type then the cost in copying the value is minimal, but copying a complex object is expensive in terms of performance and memory consumption. If the function parameter is declare constant, you can be assured the object's immutable members will not be affected by the function. If it is non-constant and you do not wish your object to be altered, you can either copy the object and pass the copy, or pass the object by value if the function is overloaded to cater for this eventuality (good code will provide both options).


What function enables the user to input information while the program is being executed in c?

The scanf() function is a commonly used function to input information during the execution of a program. scanf() function has its prototype in the stdio.h header file. To accept and display a number: int num; printf("Enter a number: "); scanf("%d",&num); printf("You entered %d",num); To accept and display a character, replace %d with %c and make num a character variable [char]. Plus: gets, fgets, read, fread, getchar, getc, fgetc, getch...