Сначала я публикую исходный код
файл .h
Код: Выделить всё
class Complex{
private:
int r = 0;//initializer
int i ;
public:
Complex(int , int I = 0);
Complex();
void print();
void set(int, int I = 1);
static void print_count();
static int count;
};
Код: Выделить всё
#include
#include "complex.h"
int Complex::count = 1;
Complex::Complex(int R , int I){
r = R;
i = I;
count++;
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/17356290/why-this-data-member-is-initialized[/url]
Мобильная версия