Quiz · Classes and OOP · lesson 3 of 13
Quiz — field initialization order
What does the program print?
#include <iostream>
struct Note {
Note(char c) { std::cout << c; }
};
struct Pair {
Note first;
Note second;
Pair() : second('2'), first('1') { std::cout << '3'; }
};
int main() { Pair p; }