Top "Variable-declaration" questions

In computer programming, variable declaration specifies properties of a variable (such as its type).

C++ Declaration of class variables in header or .cpp?

So far, I've been using classes the following way: GameEngine.h declares the class as follows class GameEngine { public: // Declaration …

c++ header-files variable-declaration
C++11 - declaring non-static data members as 'auto'

Does C++11 allow declaring non-static data members as 'auto' if they are initialized in the declaration? For example: struct S { …

c++ c++11 auto variable-declaration
What does "var FOO = FOO || {}" (assign a variable or an empty object to that variable) mean in Javascript?

Looking at an online source code I came across this at the top of several source files. var FOO = FOO || {}; …

javascript namespaces variable-declaration or-operator
Why doesn't C# let you declare multiple variables using var?

Given the following: // not a problem int i = 2, j = 3; so it surprises me that this: // compiler error: Implicitly-typed local variables …

c# declaration implicit-typing variable-declaration
Effect of declared and undeclared variables

What is the major difference between JavaScript declared and undeclared variables, since the delete operator doesn't work on declared variables? …

javascript variables global-variables variable-declaration
What is the difference between int* ptr and int *ptr in C?

I am fairly new at C and I don't know the difference between the following two variable declarations: int* ptr; …

c pointers syntax variable-declaration
Declaring vs Initializing a variable?

I'm curious to know the difference between declaring a variable, and initializing a variable. e.g. var example; // this is …

javascript variable-declaration variable-initialization
How to declare multiple variables with specifying type using As in VBA?

According to this documentation by Microsoft, the following code can be used to make sure; a, b, and c are …

excel vba declaration variable-declaration
Why do some variables declared using let inside a function become available in another function, while others result in a reference error?

I can't understand why variables act so strange when declared inside a function. In the first function I declare with …

javascript variable-declaration
Golang mixed assignment and declaration

I started working with go for a few weeks, and (once again) I stumbled across something that seems odd for …

go variable-assignment variable-declaration