Only if you pass a pointer to it, eg:
void sub (int *into)
{
*into= 3;
}
int main (void)
{
int myvariable;
sub (&myvariable);
return 0;
}
The "zero" or "root" of such a function - or of any other function - is the answer to the question: "What value must the variable 'x' have, to let the function have a value of zero?" Or any other variable, depending how the function is defined.
To find the value of the other variable
A function is linear if one variable is directly proportional to the other.
Linear function:No variable appears in the function to any power other than 1.A periodic input produces no new frequencies in the output.The function's first derivative is a number; second derivative is zero.The graph of the function is a straight line.Non-linear function:A variable appears in the function to a power other than 1.A periodic function at the input produces new frequencies in the output.The function's first derivative is a function; second derivative is not zero.The graph of the function is not a straight line.
extraneous variable
It is not necessary to to declare variables inside the function in C. If you declare a variable inside a function, the variable becomes local for the function and another variable of same name can be declared in any other function, but you can not use the variable declared in other function. When you declare any variable outside the function body then the variable becomes global and can be used in any function of the program. Note: errno is an example for a variable declared outside any function.
Global variables are non-local variables. That is, variables that are not defined in a function or class. They are globally accessible to all code in the same translation unit. External variables are global variables that have external linkage; they are accessible across translation units.
A public function is scoped to the class in which it is declared. If declared non-static, then it must be invoked against an instance of the class but if declared static then namespace resolution is required to access the function. A non-member function is not scoped to any class but may be scoped to a namespace. If no namespace is specified, then it is scoped to the (unnamed) global namespace. If scoped to any other namespace then namespace resolution is required to access the function.
The Scope of a variable defines the areas of a program where this variable would be visible and can be used. For ex: a. Method variables - are visible only inside the method where they are declared and hence their scope is only the method b. Class variables - are visible inside the class and can be used by any method inside the class and hence their scope is the whole class.
We can access a Friend function from any other class in which friend function is introduced or declared even if the other class is not a member of first class. But when we use normal member function, we can have its access only in the derived classes of the first class. This is the basic difference between a friend function and a normal member function.
To be able to access a variable declared in one file/class from another file/class you need to declare that variable as "public". Doing this is a very bad coding practice because exposing a variable of a class to be available publicly to other classes is totally against the Java object oriented concepts of Encapsulation and Data hiding. So, preferably you shouldn't be doing this. However, a better way to do this is, declare the variable as private and have public accessor methods through which you can access this variable. This will ensure that your data is protected even if it is available outside the class
Other than that the friend has privileged access to the private members of the class in which it is declared a friend, there are no implications. However, there has to a be a reason for the friend to require that access.
The "zero" or "root" of such a function - or of any other function - is the answer to the question: "What value must the variable 'x' have, to let the function have a value of zero?" Or any other variable, depending how the function is defined.
The keyword public is an access specifier. A variable or a method that is declared public is publicly accessible to any member of the project. Any class or method can freely access other public methods and variables of another class.
To find the value of the other variable
When it doesn't fulfill the requirements of a function. A function must have EXACTLY ONE value of one of the variables (the "dependent variable") for every value of the other variable or variables (the "independent variable").
When it doesn't fulfill the requirements of a function. A function must have EXACTLY ONE value of one of the variables (the "dependent variable") for every value of the other variable or variables (the "independent variable").