Top "Initializer" questions

Initializers are called to create a new instance of a particular type.

How to initialize static pointer with malloc in C?

I'm trying to initiate a static variable (inside a function) with malloc in C, but I'm getting the "initializer not …

c static malloc constants initializer
Multiple constructors: the Pythonic way?

I have a container class that holds data. When the container is created, there are different methods to pass data. …

python constructor initialization initializer idiomatic
Why are C# 3.0 object initializer constructor parentheses optional?

It seems that the C# 3.0 object initializer syntax allows one to exclude the open/close pair of parentheses in the …

c# syntax types language-design initializer
Initializer vs Constructor

I have heard that the __init__ function in python is not a Constructor, It's an Initializer and actually the __new__ …

python constructor initializer
C# initialiser conditional assignment

In a c# initialiser, I want to not set a property if a condition is false. Something like this: ServerConnection …

c# initializer
How to create initializer to create and migrate mysql database?

I have been learning how to use EF for a week or so now and am stuck on the issue …

c# mysql migration entity-framework-4.3 initializer
need self to set all constants of a swift class in init

I have a Swift class that has a constant ivar (are they called instance constants now?). To set the value …

swift self initializer
static readonly field initializer vs static constructor initialization

Below are two different ways to initialize static readonly fields. Is there a difference between the two approaches? If yes, …

c# c#-3.0 c#-2.0 initializer static-constructor
Subclassing NSWindowController in Swift and init(windowNibName)

I am trying to start a new document based Cocoa project in Swift and want to create a subclass of …

cocoa swift initializer nswindowcontroller
Static Initialization in Go?

I'm currently working on the Go Lang tutorial, but ran into problem with one of the exercises: https://tour.golang.…

static go initializer static-initialization