A
Anarki
#include <iostream>
using namespace std;
class Test
{
public:
Test()
{
cout << "Hello" << endl;
}
};
int main()
{
Test *p = new Test; //Statement 1
Test *q = new Test(); //Statement 2
return 0;
}
I want to know is there any difference between the Statement 1 and
Statement 2? If so what is it? please explain
using namespace std;
class Test
{
public:
Test()
{
cout << "Hello" << endl;
}
};
int main()
{
Test *p = new Test; //Statement 1
Test *q = new Test(); //Statement 2
return 0;
}
I want to know is there any difference between the Statement 1 and
Statement 2? If so what is it? please explain