answersLogoWhite

0

AnswerYes, it can. For instance, if your function returns double you can assign the function call to a variable of type double.
AnswerNo, only the returned value, of course.
User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is the advantage of static character variable?

Static variables exist for the entire duration of the program. Therefore a static character variable is a character that exists for the entire duration the program is running. Regardless of where a static variable is declared and initialised, it is physically instantiated and initialised when the program loads. If the variable has function scope, whatever value is currently assigned to the variable will remain in effect the next time that function is called, but only the function can modify the variable. If the variable has class scope, then the variable exists even if no instances of the class have yet been instantiated, but any and all instances share the variable (it is common to the class, not to any one instance of the class). Static class variables must be initialised outwith the class body and outwith any other function body, but can only be modified by the class members (both static and non-static) and by friends of the class. If the variable has file scope, then the variable is a global variable. Global variables are largely frowned upon as there's no way to control what code can modify the value. Passing local function variables to other functions is the preferred method as this gives much greater control over which code can access and/or modify the value, as well as limiting the lifetime of the variable. To ensure the variable exists throughout a program's lifetime (as per a static variable), instantiate the variable from within the program's entry point.


How do you declare local and global variables in pseudo code?

Pseudocode is not a programming language (it's specifically intended for human interpretation), so there is no need to declare variables, you simply define them as and when you require them. For instance: Let x = 42 Let y = x * 2


When do you declare a variable method and a class final?

When There is No Need to Change the Values of the Variables In Entire lifetime of That variables then we must use that Variable as Final Variable.


what type of variable is visible to every module and the entire program?

If you are talking about a class in Java, a variable encapsulated by a class is called an instance variable b/c everytime you create an object with that class, each object has its own set of the variables declared.


How you pass array elements to a function?

Passing array elements to a function is achieved by passing the individual elements by reference or by value, just as you would any other variable. However, passing the entire array requires that you pass a pointer-to-pointer to the array along with the dimension(s) of the array.

Related Questions

What is the advantage of static character variable?

Static variables exist for the entire duration of the program. Therefore a static character variable is a character that exists for the entire duration the program is running. Regardless of where a static variable is declared and initialised, it is physically instantiated and initialised when the program loads. If the variable has function scope, whatever value is currently assigned to the variable will remain in effect the next time that function is called, but only the function can modify the variable. If the variable has class scope, then the variable exists even if no instances of the class have yet been instantiated, but any and all instances share the variable (it is common to the class, not to any one instance of the class). Static class variables must be initialised outwith the class body and outwith any other function body, but can only be modified by the class members (both static and non-static) and by friends of the class. If the variable has file scope, then the variable is a global variable. Global variables are largely frowned upon as there's no way to control what code can modify the value. Passing local function variables to other functions is the preferred method as this gives much greater control over which code can access and/or modify the value, as well as limiting the lifetime of the variable. To ensure the variable exists throughout a program's lifetime (as per a static variable), instantiate the variable from within the program's entry point.


How do you declare local and global variables in pseudo code?

Pseudocode is not a programming language (it's specifically intended for human interpretation), so there is no need to declare variables, you simply define them as and when you require them. For instance: Let x = 42 Let y = x * 2


What is a variable that does not change in an experiment?

The variable that stays the same throughout the entire experiment is called the control.


What is the controlled variable in a science fair experiment?

The controlled variable is the variable that is kept constant , meaning not changed, throughout the entire experiment.


How can I calculate the standard deviation of a portfolio in Excel?

To calculate the standard deviation of a portfolio in Excel, you can use the STDEV.P function. This function calculates the standard deviation based on the entire population of data points in your portfolio. Simply input the range of values representing the returns of your portfolio into the function to get the standard deviation.


In an experiment what is the variable that stays the same during the entire experiment?

The variable that stays the same during the entire experiment is called the control variable. It is used as a baseline comparison to ensure that any changes observed in the experiment are due to the manipulated independent variable and not outside factors.


Responsibility of janitor?

to clean and keep the cleanliness in the entire or assigned place


When do you declare a variable method and a class final?

When There is No Need to Change the Values of the Variables In Entire lifetime of That variables then we must use that Variable as Final Variable.


Who returns from a labor camp to find thta his entire family is gone?

Saul Sanchez


What is the relationship with nucleus?

its the function of the entire cell =)


what type of variable is visible to every module and the entire program?

If you are talking about a class in Java, a variable encapsulated by a class is called an instance variable b/c everytime you create an object with that class, each object has its own set of the variables declared.


How you pass array elements to a function?

Passing array elements to a function is achieved by passing the individual elements by reference or by value, just as you would any other variable. However, passing the entire array requires that you pass a pointer-to-pointer to the array along with the dimension(s) of the array.