I have a problem understanding why you cannot do file i/o operations in a C++ constructor when declaring it as such:
MyClass *my = new MyClass;
Now for example within that constructor I could be executing file i/o operations such as printf or cout or even opening a file pointer ... the program fails and then the infamous "Segmentation Fault" occurs.
Why is this? I've never been taught why in class or never in my experience with C++ have come across this.