Top "Global-variables" questions

Global variables are variables that are accessible from all elements of a software component.

Why are global and static variables initialized to their default values?

In C/C++, why are globals and static variables initialized to default values? Why not leave it with just garbage …

c++ c static global-variables
Global Variable, subroutine variable Question in Perl

How can I transfer the subroutine variable value into another subroutine variable, Can I use global variable. sub foo(){ my $…

perl global-variables subroutine
Set javascript global variables across multiple pages

I want to store global variables in javascript array to make them available for multiple pages. I know that cookies …

javascript jquery html global-variables persistent-storage
Implementing a Shopping Cart

I am making an Android app where I am implementing a Shopping Cart. When the user selects an item, it …

android sqlite android-activity global-variables shopping-cart
How to access a global variable within a local scope?

This is my code #include <iostream> using namespace std; int x = 5; int main() { int x = 1; cout << "…

c++ global-variables local
Global scss variables for Angular components without importing them everytime

I do already have SCSS variables defined in src/styles/settings/_variables.scss and I am importing them into src/…

css angular sass global-variables angular7
Open a .txt file into a richTextBox in C#

I want to be able to open a .txt file up into a richtextbox in c# and also into a …

c# richtextbox global-variables text-files openfiledialog
Are global variables in C++ stored on the stack, heap or neither of them?

I have an exam on tuesday and I've noticed that, this question is one that my teacher asks a lot …

c++ global-variables heap-memory stack-memory
Global variables in C are static or not?

Are global variables in C static or extern by default? If global variables are by default static then it means …

c static global-variables extern
How do I access the global object (window) using webpack?

I'm trying to interface ActionScript with JavaScript using ExternalInterface and webpack. ExternalInterface can only provoked (call) functions found on the …

javascript actionscript-3 global-variables externalinterface webpack