What are the differences with these 3 object initialization and when we are calling an object, what is literally happening?
#include <iostream>
class SampleClass {
    public:
    int a;
    SampleClass (int x) {
        a = x;
    }
};
int main() {
    //are there any differences with these 3 object initialization?
    SampleClass obj = 5;
    SampleClass obj1 = SampleClass(10);
    SampleClass obj2(15);
    printf("%d",obj,"\n"); //why does this work, if obj is referring to the first data member of the class
    //int b = obj; //then why couldn't i do this?
    //std::cout << obj << std::endl; //and why does printf works with obj and cout doesn't?
    return 0;
}
 
    