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

  • SEARCH
  • Home
  • 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 6602159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:50:38+00:00 2026-05-25T18:50:38+00:00

on the line *binSon[0].add(x); , it give me an error, an expression must have

  • 0

on the line *binSon[0].add(x);, it give me an error, an expression must have a class type, what do i do?

struct Rectangle
{
    tName Name; //name of the rectangle
    struct Rectangle *binSon[NDIR_1D]; //left and right son
    int Center[NDIR_1D];
    int Length[NDIR_1D];

    void add(Rectangle x){
        if(strcmp(x.Name,Name)<0)
        {
            if(binSon[0]==NULL)
                binSon[0]=&x;
            else
                *binSon[0].add(x);

        }else{
            if(binSon[1]==NULL)
                binSon[1]=&x;
            else
                *binSon[1].add(x);
        }
    }
};
  • 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-05-25T18:50:38+00:00Added an answer on May 25, 2026 at 6:50 pm

    Your problem here really isn’t quite what you think, although it can be solved as is.

    The correct syntax is:

    binSon[0]->add(x);
    

    The -> operator is member-of-pointer, which handles everything for you. Typically, -> should be used with pointers and . with references or the object itself (the exceptions are in interesting spots).

    To do it how you want (which you really shouldn’t), (*binSon[0]).add(x) should work. The precedence of the operator is likely your issue at the moment.

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

Sidebar

Related Questions

On line 6 below, I have $(ul.tabrow li).removeClass(active); //Remove any active class If I
Line of bug is this: contxt.replaceWith(safe_copy[id]).prepend(<span class='error'>+jsonObj.data+</span>); While the replaceWith statement works just fine
this line of code is for the navigation bar of Apple.com #globalheader #globalnav[class*=nosearch] {
this line: <li><?php echo $form['genero']->renderLabel() ?></li> is generating <li> <label for=usuario_genero>Genero</label> <ul class=radio_list> <li>
I have a command line application that needs to support arguments of the following
I have a parser generated using Flex/Bison - it parses each line of a
In the class section of my code, if I write an error a few
Line 8, Column 23: document type does not allow element STYLE here If I
[Solved] Writing parsing code is a trap. A line with 15 spaces will have
Line 13 in XML document from class path resource [ApplicationContextAOP.xml] is invalid; nested exception

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.