Wiki User
∙ 2010-01-18 12:07:35Global variables can be seen in all blocks of your program, when local variables are visible only within the block where it's declared.
Wiki User
∙ 2010-01-18 12:07:35glo
You declare global and local variables in pseudocode the same way you declare them in real code. You place local variables within blocks, and you place global variables outside of all blocks.
When you say static variable, do you mean local static variable or global static variable? In C, the difference between global static variables and global variables is that static in this case means that the variable can be used only in the module (.c file) that it is declared. The difference between a local static variable and a global variable is the scope: the local variable can be used only inside the function that declares it. So you can have 2 local static variables in the same file with the same name but in different functions and they will be 2 different variables.
Only global/static variables are, local variables aren't.
A static variable is a variable allocated in static storage. A local variable is a variable declared inside a function. A global variable is a variable declared outside of any class or function. Note that local variables and global variables can both be allocated in static storage.
A global variable can be seen in any scope. Local variables can be seen only in their scopes and any sub-scopes. ex: int x; //global: visible in all scopes void func() { //scope 1 int y; // local: visible in scope 1 and scope 2 { //scope 2 int z; // local: visible *only* in scope 2 } }
Hi, I would like to answr the question.So, if you want the to give more precedence to global variables with respect to a local one.Just add a pair of curly braces in the local variable and by doing so u can access global variable.
RAM = Random Access Memory
The variables which are declared outside the main() function is known as global variables and they can be used anywhere in the program. And, the variables which used declare inside the main() function is known as local variables and they can be used inside the main() function only. Example: #include<stdio.h> #include<conio.h> int x,y; // global variables void main() { int a,b; // Local variables ------------ ---------------------- --------------------- getch(); }
Global and local variables can be displayed in flowcharts typically as overlays or in region specific flowcharts. General flowcharts on the base chart cannot accommodate multiple variations.
In Raptor: Global variables are to be displayed in the assignment window, while the local ones need to be input into the input box.
Coupling is the interdependency of a program. A program that uses local variables is more independent than one that uses global variables. Therefore, the program would be considered to have lower coupling.