Top "Declaration" questions

Declaration is the part of the subprogram (procedure or function) which provides the protocol(header), but not the body of the subprogram.

PHP: how to avoid redeclaring functions?

I tend to get errors such as: Fatal error: Cannot redeclare get_raw_data_list() (previously declared in /var/www/…

php function declaration
Define local function in JavaScript: use var or not?

When a local (inner) function is declared in JavaScript, there are two options: Declaring with var keyword, assigning to the …

javascript function closures declaration
Declaring variables inside a switch statement

I saw a few answers to this issue, and I get it — you can't declare and assign variables inside a …

objective-c c variables switch-statement declaration
Why is adding attributes to an already instantiated object allowed?

I am studying python, and although I think I get the whole concept and notion of Python, today I stumbled …

python attributes python-3.x declaration
When to use an object instance variable versus passing an argument to the method

How do you decide between passing arguments to a method versus simply declaring them as object instance variables that are …

variables methods parameter-passing declaration
Variables scope which are defined within a while block in stored procedures - SQl Server

I've come across a interesting scenario (at least for me) in a stored procedure. Would like to have experts opinion …

sql-server sql-server-2008 variables scope declaration
Why does initializing an extern variable inside a function give an error?

This code compiles fine: extern int i = 10; void test() { std::cout << "Hi" << i << std::…

c++ declaration definition extern
Function parameter types and =>

What exactly that declaration of method parameter means: def myFunc(param: => Int) = param What is meaning of => in …

scala parameters declaration
Why does "extern const int n;" not work as expected?

My project consists of only two source files: a.cpp: const int n = 8; b.cpp: extern const int n; int …

c++ constants declaration extern
Is is a good practice to put the definition of C++ classes into the header file?

When we design classes in Java, Vala, or C# we put the definition and declaration in the same source file. …

c++ declaration definition header-files