Answer the question
In order to leave comments, you need to log in
How to initialize C++11 variables?
How do you initialize variables?
int emus {7}; // устанавливает emus в 7
int rheas = {12}; // устанавливает rheas в 12
int rocs = {}; // устанавливает rocs в 0
int psychics {}; // устанавливает psychics в 0
Answer the question
In order to leave comments, you need to log in
You can also do this:
int n(10);
Sometimes I omit, because it is short and just as clear.
The fact is that curly braces are from the new standard
int n = 42;
Because it is more familiar, clearer and shorter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question