Top "Local-variables" questions

Local variables have a limited scope, generally one function or one functional block.

How to declare a variable in SQL Server and use it in the same Stored Procedure

Im trying to get the value from BrandID in one table and add it to another table. But I can't …

sql-server stored-procedures local-variables
Can a local variable's memory be accessed outside its scope?

I have the following code. #include <iostream> int * foo() { int a = 5; return &a; } int main() { int* p = …

c++ memory-management local-variables dangling-pointer
Access a function variable outside the function without using "global"

I am trying to access a local function variable outside the function in Python. So, for example, bye = '' def …

python local-variables
Default Values and Initialization in Java

Based on my reference, primitive types have default values and Objects are null. I tested a piece of code. public …

java initialization global-variables default-value local-variables
Returning string from C function

I haven't used C in over 3 years, I'm pretty rusty on a lot of things. I know this may seem …

c string return local-variables
What's the scope of a variable initialized in an if statement?

I'm new to Python, so this is probably a simple scoping question. The following code in a Python file (module) …

python variables if-statement scope local-variables
Java how to print all local variables?

I have a method and want to examine variables inside it without debugging - is it possible in Java? I …

java local-variables
How to make a variable inside a try/except block public?

How can I make a variable inside the try/except block public? import urllib.request try: url = "http://www.google.…

python python-3.x scope local-variables try-except
returning a local variable from function in C

#include <stdio.h> int foo1(void) { int p; p = 99; return p; } char *foo2(void) { char buffer[] = "test_123"; return …

c pointers local-variables
Why a variable defined global is undefined?

I have here a simple function and a global variable. Why is myname undefined and not the string "global"? var …

javascript global-variables local-variables hoisting