I had a question on the following C++ code. Can someone explain the constructor initialization list because I don't understand why we are saying x(a) like its a function? Also in the main, why are they using b(10) and not x?
#include <iostream>
using namespace std;
class Base{
int x;
public:
Base(int a):x(a) {}
};
int main() {
Base b(10);
return 0;
}