Conversion from "" to non-sclar trpe " " requested.

Discussion in 'C Programming' started by AddisLig, Nov 16, 2008.

  1. AddisLig

    AddisLig

    Joined:
    Nov 16, 2008
    Messages:
    1
    Hi All,

    I am new to C++ and have this poject to finish by end of next week. I am getting error for the following code...

    =======
    class Property{
    private:
    //private method that uses the static state of class
    int newID();
    protected:
    long price;
    string address;
    string type;
    static int propID; //Static Index number for searching purpose

    public:
    Property(string anAddress, long aPrice, string hType);
    Property(string anAddress, long aPrice);//needed to display + overload later
    Property(string anAddress);
    virtual ~Property(); //Destructur for the Property Class
    Property operator + (Property); // Operator Overload
    bool operator == (Property); //Operator overload
    virtual void display();
    virtual void changePrice(long);

    };

    int Property::propID=323500; //Initialise the static ID number
    //........

    int main (){
    //.....
    Property prop1 = new Property("Address in Las Vagas");
    Property* prop1Ptr = &prop1;
    prop1Ptr->display();
    //....
    }

    I get above error in line

    Property prop1 = new Property("Address in Las Vagas");
    Basically I have hit a brick wall.

    Thanks in advance for your help.
     
    AddisLig, Nov 16, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Chesnay
    Replies:
    0
    Views:
    787
    Chris Chesnay
    Apr 6, 2005
  2. venu reddy

    conversion to non-scalar type requested error

    venu reddy, Feb 19, 2007, in forum: C Programming
    Replies:
    2
    Views:
    16,984
    Barry Schwarz
    Mar 4, 2007
  3. tthunder@gmx.de
    Replies:
    11
    Views:
    11,380
    tthunder@gmx.de
    Jun 5, 2006
  4. subramanian100in@yahoo.com, India

    conversion operator and conversion ctor

    subramanian100in@yahoo.com, India, Sep 15, 2009, in forum: C++
    Replies:
    2
    Views:
    511
    Fraser Ross
    Sep 15, 2009
  5. kenneth
    Replies:
    1
    Views:
    134
    Gunnar Hjalmarsson
    Dec 11, 2004
Loading...

Share This Page