+ 1
Ошибка или фича? Урок 61.1 3 задание
Не инициализированы переменные через " : " Сначала бросилось в глаза потом подумал что они не константы, но в следующем уроке 62.1, уже инициализированы!?
3 Antworten
+ 2
Class variables can be initialized in constructors using : 
class A
{
    int m;
public:
    A(int x)
    :m{x};
    {
    }
};
This method is used to "initialize" class variables.
And there is no lesson named 61.2
+ 1
Алексей Климов yes it need initialization. You are right
0
Oops, lesson 62.1 - correct code.
61.2, 3 task - incorrect initialized variables code?
.... People (Str n, Birthday bo);
Private:
String name
Birthday date
An need 
People (string n, Birthday bo) 
: name(n), date(bo)?



