The closest thread to my question is here. I am trying to compile the following code with gcc:
#include <malloc.h>
class A
{
public:
A(){};
~A(){};
};//class A
int main()
{
A* obj = (A*) malloc( sizeof(A) );
if(obj==0) return 1 ;
obj->A::A(); /*error: invalid use of 'class A' */
obj->A::~A();
free(obj);
return 0;
};//
From the command line I compile the code with:
$ g++ -o main main.cpp main.cpp: In function 'int main()': main.cpp:22: error: invalid use of 'class A'
Can you please point me in the right direction?