I used std::malloc() on a pointer which is a member of an object. And in a method, it threw an error.
[...]
class SomeClass
{
public:
void method()
{
this.ptr = std::malloc(4);
}
int* ptr;
}
[...]
And it throws an error saying:
Error: Expression must have class type
What is the problem in my program?