Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8763929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:53:57+00:00 2026-06-13T15:53:57+00:00

Hi Experts can I do dynamic binding like this. objshapes is the parent class

  • 0

Hi Experts can I do dynamic binding like this.
objshapes is the parent class called Shape and Rectangle is the child class. I have a few child classes so depending which shape the user selects, I need to bind the correct shape to the objShapes. So i thought i can bind like this. but i getting an error.

 Shape *objShapes[3];    
 objshapes[size]= &new Rectangle(3,lvaule,5)  

 //error: lvalue required as unary ‘&’ operand

Hope someone can assist. Thanks

IS THIS CORRECT

  objshapes[size]= new Rectangle(3,lvaule,5)  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:53:58+00:00Added an answer on June 13, 2026 at 3:53 pm
    Shape *objShapes[3];
    

    This declares objshapes as an array of 3 pointers-to-Shape.

    objshapes[size]= &new Rectangle(3,lvaule,5)  
    

    This is non-sensical.

    IS THIS CORRECT

    objshapes[size]= new Rectangle(3,lvaule,5) 
    

    Yes1, that is correct. new returns a pointer-to-Rectangle, which can be stored in a variable of type pointer-to-Shape. Since objshapes is an array of pointers-to-Shape. objshapes[size] is pointer-to-Shape — which can accept a pointer-to-Rectangle.

    1. Assuming that size is convertable to an integral type, and has the value 0, 1, or 2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this json page: https://www.googleapis.com/books/v1/volumes?q=9789264187061 which looks like this: { kind: books#volumes, totalItems:
For passing dynamic values to js code, is it better to do like this?
Hope you guys can help me. This is my situation. I have a stored
i have a method registered like this: [DllImport(MyApi.dll, CharSet = CharSet.Ansi)] private static extern
Hello Experts can somebody please indentify the problem with this server why this is
Hi Experts I have a special question About dynamic Linq to Sql. Consider we
java experts can you please help me write detached queries as a part of
I’m new to JQuery and I hope some experts can help me with a
I'm very keen to learn Iphone apps development. Can you experts give me some
Can any trig or GPS experts help me out here? I'm trying to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.