I'm trying to understand code below.
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
class A
{
public :
void Test();
};
void A::Test()
{
ShowMessage("Hello");
}
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
A *x;
x->Test();
}
I expect EAccessViolation error,when I call the Test method.
How does work without the x assign ?