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 7560211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:50:27+00:00 2026-05-30T12:50:27+00:00

Im a bit stumped here. Im working on building a binary heap class, modeled

  • 0

Im a bit stumped here. Im working on building a binary heap class, modeled by an array. I’m trying to take two arrays of strings, and concatenate them together (for a merge function) to create a new array, which I’ll then perform sorting operations on.

Both of the arrays are initialized like so in my interface:

string *heapArray;

Both arrays are constructed as so in my implementation:

heapArray = new string[10];

And the code that I tried, which won’t compile, is this:

merged->heapArray = one->heapArray + two->heapArray;

So obviously I’ve done something wrong here, but I haven’t done any concatenation of raw C++ arrays in the past, mostly play it safe with vectors. Alas, working on this optimization assignment requires it. Any guidance would be appreciated.

I realize I haven’t posted much code, but I get frustrated by people who post mass blocks of code on here. I’ve posted what I think is relevant, but if there is something specific I’m missing which would be helpful, let me know and I’ll add it.

  • 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-30T12:50:29+00:00Added an answer on May 30, 2026 at 12:50 pm

    When dealing with straight C++ arrays, the only way to add two of them together like that is to allocate a new array, and insert them one by one from the two source arrays into the new one

    EDIT:
    Or a memcpy, but that isn’t as easy with a non-basic data type

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

Sidebar

Related Questions

I'm a bit stumped here, I'm trying to make it so an image (already
Here's one that's got me stumped. Working in PHP5. I am building a store
Hi guys I'm using this wonderful class here to do a bit of code
Ok, a bit stumped here, and instead of banging my head any more on
Here's something that's got me a bit stumped but intrigued all the same. In
I am trying to figure this out but am stumped a bit. What I
I'm a bit stumped here. I am developing a feedback utility that will allow
It's a bit silly asking homework questions here, however I'm genuinely stumped as to
I am a little bit stumped with the following problem and I am afraid
I am fairly new to c++ and I am a bit stumped by this

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.