answersLogoWhite

0


Best Answer

No the two work together REALLY

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Suppose an external variable is defined outside of function A and accessed within the function Does it matter whether the external variable is defined before or after the function. Explain?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Explain the scope and visibility of variables in c plus plus function?

If you define a variable inside of your function, the variable can be referred and used only inside of that function. It means that you will not able to use the variable in another function (including main). Area of code where your variable can be used after declaration is usually called visibility of the variable.


Is potentiometer and Thermistor are variable resistors. How please explain?

A: A potentiometer is a manual device to change the resistance A thermistor changes as a function of environment temperature


What is the difference between static global and local global variable?

First, lets speak about the scope of a variable. The scope of a variable is the section of the application that can see and manipulate that variable. If the variable is declared in a procedure when that procedure is called, only that procedure can use that variable. Hence that variable is considered "Local". Now Static. Static variables are variables that are created with the static key word as in:- function ab(var1 as integer)as integer static iTotal as integer itotal =iTotal + var1 (rest of ccode goes here) end function Now when this function is called the first time, iTotal will be assigned the value of var1. The next time the function is called, iTotal will retain the previous value and the new value of var1 will be added to it. Hope this helps. (theTeacha) Static variables life time is not under any scope.It initializes only one time from creation to delete.let me explain by a pgm. void main() { int a=1; static s=1; int k=0; for(k=0;k<1;k++) { i++; s++; main(); } printf("%d is i",&i); printf(%d is S",&s); getch(); } Output will be 2 is i 3 is s It Shows that local variable initialize every time the function call.But Static variable initializes only once <><><> For a variable, static means it keeps its value even when the enclosing code is not active--out of scope. A static variable is assigned to a fixed memory location when the program runs, so it is possible to examine a static variable at any time the program is active, even when the function where the var is declared is not active. A local variable is dynamically allocated storage space when a function is called, and its storage is given up when the function ends, so it only exists while the function is executing. For a function, static declaration means it can only be called from functions in the same file (in C).


How do you accept a string by using getch() function with an example?

explain about function call


Explain pointer to function with example c language?

It isn't a question, sorry.

Related questions

Explain the scope and visibility of variables in c plus plus function?

If you define a variable inside of your function, the variable can be referred and used only inside of that function. It means that you will not able to use the variable in another function (including main). Area of code where your variable can be used after declaration is usually called visibility of the variable.


How do you explain the law of variable proportion?

Explain the Law of Variable Propotion


Is potentiometer and Thermistor are variable resistors. How please explain?

A: A potentiometer is a manual device to change the resistance A thermistor changes as a function of environment temperature


Explain development as a dependent variable?

explain development, i need it for homework


What are Explanatory variable?

Explanatory (or predictor) variable: A variable which is used in a relationship to explain or to predict changes in the values of another variable; the latter called the dependent variable.


How do you write a variable?

Explain the ide of matlab


How do you write variable?

Explain the ide of matlab


Describe the production function with one variable input and explain the relationship between TPMP and AP curves and the three stages of production?

there are three stages of production mp>ap


What is the controlled variable for an electromagnetic experiment?

explain your project


Is an attempt to explain the behavior of one variable as a result of its relationship to and dependence on another variable?

Stage of denial


Explain the different access storage specifiers available in c?

The storage class specifiers in C and C++ are:autoexternmutableregisterstatictypedefA storage class specifier is used to refine the declaration of a variable, a function, and parameters


What is the difference between static global and local global variable?

First, lets speak about the scope of a variable. The scope of a variable is the section of the application that can see and manipulate that variable. If the variable is declared in a procedure when that procedure is called, only that procedure can use that variable. Hence that variable is considered "Local". Now Static. Static variables are variables that are created with the static key word as in:- function ab(var1 as integer)as integer static iTotal as integer itotal =iTotal + var1 (rest of ccode goes here) end function Now when this function is called the first time, iTotal will be assigned the value of var1. The next time the function is called, iTotal will retain the previous value and the new value of var1 will be added to it. Hope this helps. (theTeacha) Static variables life time is not under any scope.It initializes only one time from creation to delete.let me explain by a pgm. void main() { int a=1; static s=1; int k=0; for(k=0;k<1;k++) { i++; s++; main(); } printf("%d is i",&i); printf(%d is S",&s); getch(); } Output will be 2 is i 3 is s It Shows that local variable initialize every time the function call.But Static variable initializes only once <><><> For a variable, static means it keeps its value even when the enclosing code is not active--out of scope. A static variable is assigned to a fixed memory location when the program runs, so it is possible to examine a static variable at any time the program is active, even when the function where the var is declared is not active. A local variable is dynamically allocated storage space when a function is called, and its storage is given up when the function ends, so it only exists while the function is executing. For a function, static declaration means it can only be called from functions in the same file (in C).