Kk Boy Essay

251 WordsApr 13, 20152 Pages
Advantages Of Global Variables 1. If some common data needed to all functions can be declared as global to avoid the parameter passing. 2. Any changes made in any function can be used / accessed by other. 3. A global variable is variable that can accessible in every scope. 4.A global variable can potentially be modified from anywhere. 5.The main advantage of global variable is you can access it from anywhere in your program Disadvantage Of Global Variables 1. Can Be accessed by anyone from anywhere 2. can give you unexpected results, unless you are confident you are inside the loop. 3. Widgets and other plugins can rewind your posts, loop through post to a different position, and other actions that could cause you to get results that you did not want or expect. 4. Since you don't tell us where your shortcode is getting executed, it is possible that it may be outside the loop, and could give unexpected results. 5. Memory allocation issues Some environments have memory allocation schemes that make allocation of globals tricky. How Can You Declare Global & Local Variables In Flowcharts? In Raptor Global variables are to be displayed in the assignment window, while the local ones need to be input into the input box. How Can You Declare Global & Local Variables In Pseudocode? A local variable is a variable declared inside a construct, such as a class or function, while a global variable is a variable declared outside of any

More about Kk Boy Essay

Open Document