This is probably just something I don't understand about c++, but why does this code give me a runtime error? If I don't initialize someInt2 or I don't specify that aClass has an int member, I don't get the error.
using namespace std;
class aClass
{
int someint;
public:
aClass()
{
someint=4;
}
};
int bFunc()
{
return 4;
}
aClass aFunc()
{
aClass class1=aClass();
return class1;
}
int main()
{
int * someInt2;
*someInt2=bFunc();
aClass * thisClass;
cout << "Got here" << endl;
*thisClass=aFunc();
cout << "Not here" << endl;
return 0;
}