Top "Variable-initialization" questions

In computer programming, initialization is the assignment of an initial value for a data object or variable.

Declare and assign multiple string variables at the same time

I'm declaring some strings that are empty, so it won't throw errors later on. I've read that this was the …

c# variable-declaration variable-initialization
C: Cannot initialize variable with an rvalue of type void*

I have the following code: int *numberArray = calloc(n, sizeof(int)); And I am unable to understand why I receive …

c pointers variable-initialization
Is it ok to call a function in constructor initializer list?

My gut feeling is it is not. I am in the following situation: class PluginLoader { public: Builder* const p_Builder; …

c++ constructor variable-initialization
Which is the better approach to initialize php properties?

Here are two way to initialize class variables. 1st Method class Test { private $var1; private $var2; public function Test($var1,$…

php class variable-initialization
C# - Initialize a variable without knowing what its going to be

I have two different tables in my database, and each are displayed to the user based on their "SortOrder". I …

c# .net asp.net scope variable-initialization
Java String initialization

Which do you prefer and why" String myString = null; if(someCondition) myString = "something"; else myString = "something else"; OR String myString = ""; …

java conditional preferences variable-initialization
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
What are the differences between C-like, constructor, and uniform initialization?

To the best of my knowledge, there are three ways to initialize a variable in C++. int x = 0; // C-like initialization …

c++ c++11 initialization c++03 variable-initialization
How to initialize to zero/NULL in a template

While writing a template, I want to initialize my variable to a value that serves as zero or null the …

c++ variable-initialization