Sign in to follow this  

[C++] Problem with new and custom class

This topic is 3725 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, im getting this error when I have a pointer array of my custom classes.
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'Something *' (or there is no acceptable conversion)
And heres some sample code that will give the same type of error im getting, can anyone fill me in on what i need to do to resolve it. Thanks.
#include <stdio.h>

class Something
{
public:
    Something();
    Something(const int stuff);
    ~Something();
};

void main()
{
    Something *stuff;

    stuff = new Something[10];

    stuff[0] = new Something(20);

    getchar();
}

Share this post


Link to post
Share on other sites

This topic is 3725 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this