It contains data which left after previous usage of that area of the memory.
If it is a class or instance variable, it gets the default value of false. If it is a local variable (inside a method), it doesn't have a value until you explicitly set one.
There are four types of storage classes in c. It defines the scope and lifetime of a variable or function.1. auto - This is the default storage class inside a function. Auto can only be used with in functions. i.e. only for local variables, not for globals.2. register - The variables declared using the register storage class may stored in CPU registers instead of RAM. Since it doesn't have a memory location, the '&' operator for getting the address of the variable cannot be applied (in C). This storage class cannot be used for global scope data.3. static - In case of local variable, it is initialized at compile time and retains its value between the calls. By default the static variables will be initialized to zero, in case of pointer variable initialized to NULL.4. extern - Refers to a public variable defined somewhere else (often in a different source file.)
When a variable is declared, your computer assigns a section of memory to that variable. If the variable isn't initialized, there's no way of knowing what data is already stored in that section of memory, which can cause errors in your programs. In managed languages, such as C#, this is done automatically at declaration. Although it's still good practice to initialize variables yourself.
Java by default initializes it to the default value for that primitive type. Thus an int will be initialized to 0(zero), a Boolean will be initialized to false.
A local variable is a variable that can only be called on by the module. Where as a global variable can be called upon by any module. Only statements made inside the same module can call on a local variable.
Not initialized variable: int myInt; Initialized variable: int myInt = 10;
global and static
If it is a class or instance variable, it gets the default value of false. If it is a local variable (inside a method), it doesn't have a value until you explicitly set one.
PHP static can only be initialized using a literal or constant. You can not use an expression. You can initialize it to an integer but you may not to another variable.
YES - If the variable i a constant (final variable that is already initialized) NO - If the variable is not constant and is assigned at run time.
It's almost impossible to predict, but the value will be some data left by OS when it was previously used.
There are four types of storage classes in c. It defines the scope and lifetime of a variable or function.1. auto - This is the default storage class inside a function. Auto can only be used with in functions. i.e. only for local variables, not for globals.2. register - The variables declared using the register storage class may stored in CPU registers instead of RAM. Since it doesn't have a memory location, the '&' operator for getting the address of the variable cannot be applied (in C). This storage class cannot be used for global scope data.3. static - In case of local variable, it is initialized at compile time and retains its value between the calls. By default the static variables will be initialized to zero, in case of pointer variable initialized to NULL.4. extern - Refers to a public variable defined somewhere else (often in a different source file.)
Global variables can have any value, in C they are aumaticatically initialized to zero.
When a variable is declared, your computer assigns a section of memory to that variable. If the variable isn't initialized, there's no way of knowing what data is already stored in that section of memory, which can cause errors in your programs. In managed languages, such as C#, this is done automatically at declaration. Although it's still good practice to initialize variables yourself.
Java by default initializes it to the default value for that primitive type. Thus an int will be initialized to 0(zero), a Boolean will be initialized to false.
A local variable is a variable that can only be called on by the module. Where as a global variable can be called upon by any module. Only statements made inside the same module can call on a local variable.
During declaration, the declaration goes like this: extern <type> <variable-name> or <type> <function-name> (<parameter list>);