Hi guys so I'm at the point where I think I'm comfortable enough to start trying some frameworks/apis so I am thinking of learning the qt framework so I can start developing some simple gui applications,
anyway I noticed one strange thing in the qt MainWindow.cpp file
MainWindow::MainWindow(QWidget *parent) :
so I understand that ui is a pointer and we allocate a new MainWindow object to that pointer
but when I do pretty much the same thing with my own code everytime the program crashes
using namespace std;
string text = "hey ya";
cout << "hi" << endl; // doesn't print hi?
cout << ss->text << endl;
cout << "Hello world!" << endl;
at first I thought the crash was because of an infinite recursion each constructor will keep calling a new Sample
but if this was the case shouldn't hey be printed to the console?
also how come this code works in qt yet mine won't work,I mean it's pretty much doing the same thing,
note that in the qt MainWindow header the constructor is mark explicit if that makes any difference,I tried marking my constructor in my Sample class as explicit but still crashes