Top "Initialization" questions

Initialization deals with the task of initializing the contents of your data structure.

Default values in a C Struct

I have a data structure like this: struct foo { int id; int route; int backup_route; int current_route; } and …

c initialization
C++: Where to initialize variables in constructor

Possible Duplicate: C++ initialization lists What are the pros/cons of initializing variables at option 1 vs option 2? class MyClass { public: …

c++ constructor initialization
When are static variables initialized?

I am wondering when static variables are initialized to their default values. Is it correct that when a class is …

java static initialization
How to initialize a private static const map in C++?

I need just dictionary or associative array string => int. There is type map C++ for this case. But I …

c++ static map initialization constants
JavaFX: How to get stage from controller during initialization?

I want to handle stage events (i.e. hiding) from my controller class. So all I have to do is …

javafx initialization javafx-2 javafx-8 stage
How can I initialize a C# List in the same line I declare it. (IEnumerable string Collection Example)

I am writing my testcode and I do not want wo write: List<string> nameslist = new List<…

c# list collections initialization
Difference between declaring variables before or in loop?

I have always wondered if, in general, declaring a throw-away variable before a loop, as opposed to repeatedly inside the …

java performance loops variables initialization
What happens to a declared, uninitialized variable in C? Does it have a value?

If in C I write: int num; Before I assign anything to num, is the value of num indeterminate?

c initialization declaration
How to initialise memory with new operator in C++?

I'm just beginning to get into C++ and I want to pick up some good habits. If I have just …

c++ initialization memory-management new-operator
initialize a const array in a class initializer in C++

I have the following class in C++: class a { const int b[2]; // other stuff follows // and here's the constructor a(…

c++ initialization c++03 array-initialize