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.

What are the problems that are mitigated by not allowing nested function declarations in Go?

Lambdas work as expected: func main() { inc := func(x int) int { return x+1; } } However, the following declaration inside a declaration …

function go declaration
Has the new C++11 member initialization feature at declaration made initialization lists obsolete?

With C++11, we now have the ability to initialize class members in a header declaration: class aClass { private: int mInt{100}; …

c++ c++11 constructor initialization declaration
Is it necessary to Initialize / Declare variable in PHP?

This question's purpose is to only gain knowledge or information for me and many like me. So my question is: …

php variables initialization declaration
undefined C struct forward declaration

I have a header file port.h, port.c, and my main.c I get the following error: 'ports' uses …

c struct declaration forward
In C#, What is <T> After a Method Declaration?

I'm a VB.Net guy. (because I have to be, because the person who signs my check says so. :P) …

c# methods declaration
Semicolon after class declaration braces

In C++ classes, why the semi-colon after the closing brace? I regularly forget it and get compiler errors, and hence …

c++ class oop declaration
Can a JavaScript object property refer to another property of the same object?

I recently tried to create an object like this: var carousel = { $slider: $('#carousel1 .slider'), panes: carousel.$slider.children().length }; …

javascript object properties declaration variable-assignment
An object reference is required for the nonstatic field, method, or property

I know people have asked about this question before but the scenario's were too specific and I am confused about …

c# class initialization declaration non-static
C++ Forward declaration and 'Incomplete type is not allowed' error

I have two classes (or better yet, header files) that are part of my C++ program and I simply can't …

c++ c++-cli declaration forward incomplete-type
Placement of the asterisk in pointer declarations

I've recently decided that I just have to finally learn C/C++, and there is one thing I do not …

c++ c pointers declaration