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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:13:06+00:00 2026-06-13T10:13:06+00:00

I have two vectors of MyObj structs. MyObj is defined as follows: struct MyObj

  • 0

I have two vectors of MyObj structs. MyObj is defined as follows:

struct MyObj
{
   float x, y;
   unsigned int data[8];
   unsigned int tmp[1];

   MyObj(const MyObj &m) 
   {
      x = m.x; y = m.y; 
      tmp[0] = 0;
      for (int i = 0; i < 8; ++i)
      {
         data[i] = m.data[i];
      }
   }
};

I then have two vectors…

vector<MyObj> v1; 
vector<MyObj> v2;
// both get data eventually.

v1.insert(v1.end(), v2.begin(), v2.end());

v2 has 3535004 elements in my experiment. v1 is similarly sized. I’ve also tried building a new vector and just using .push_back to build it from both vectors.

Essentially, when I try to merge the two vectors I just get an error from visual studio saying “Debug error! R6010, abort() has been called”. Very non-useful…

So my question is: what could be causing this error, and how can I solve it? Thank you

  • 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-13T10:13:07+00:00Added an answer on June 13, 2026 at 10:13 am

    vtext.cpp:

    #include <vector>
    #include <iostream>
    using namespace std;
    
    struct MyObj
    {
       float x, y;
       unsigned int data[8];
       unsigned int tmp[1];
    
       MyObj() {}
       MyObj(const MyObj &m) 
       {
          x = m.x; y = m.y; 
          tmp[0] = 0;
          for (int i = 0; i < 8; ++i)
          {
             data[i] = m.data[i];
          }
       }
    };
    
    int main(void)
    {
        vector<MyObj> v1(3535004); 
        vector<MyObj> v2(3535004);
        // both get data eventually.
    
        v1.reserve(3535004 + 3535004);
    
        cout << v1.capacity() << endl;
    
        v1.insert(v1.end(), v2.begin(), v2.end());
    
        cout << "It worked" << endl;
    }
    

    $ g++ vtest.cpp -o vtest

    $ ./vtest

    7070008

    It worked

    It worked with and without the reserve statement. Either you are working on a very low memory system (mine has 4GB) or the error is in something you haven’t shown us.

    Edit: Following @MooingDuck’s implied suggestion in his comment, if you still have problems replace the insert statement above with

    try 
    {
            v1.insert(v1.end(), v2.begin(), v2.end());
    }
    catch (exception& e)
    {
       cout << e.what() << endl;
    }
    

    and take it from there. Also add #include <exception> at the top.

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

Sidebar

Related Questions

So I have two vectors of data points, and I would like to make
Greetings, Basically, I have two vectors of data (let's call it experimental and baseline).
I have two sets of data vectors X, Y, Z and X2, Y2, Z2
I have two data frames DF1, DF2 each with 2 vectors DF1$A DF1$B, DF2$C,
I have two vectors, v1 and v2. I would like to find any of
I have two vectors, v1 and v2 v1 <- c('one', 'two', 'three') v2 <-
I have two vectors, and I would like to fill the first one with
I have two endpoints (xa,ya) and (xb,yb) of two vectors, respectively a and b,
I'd like to do the following. but don't know how: //have two vectors: vector1
Say I have two 2D vectors, one for an objects current position and one

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.