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

The Archive Base Latest Questions

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

I have made a winform app where i have used vectors of array[n][n] type

  • 0

I have made a winform app where i have used vectors of array[n][n] type using

typedef char myarray[9][9];  
typedef vector<myarray> array3d; 

as far as i have read, this feature is provided in c++0x. I am using visual studio 2010 ultimate is the error in xmemory because of this? The ide is showing no other error exept from this (not even where the above code is)

'Target of operator new()' : array initialization needs curly braces

pointing to this code in xmemory

void construct(pointer _Ptr, _Ty&& _Val)
    {   // construct object at _Ptr with value _Val
    ::new ((void _FARQ *)_Ptr) _Ty(_STD forward<_Ty>(_Val));
    }

In a code of over 2.5 k lines how do i find where’s the problem?

EDIT:

Since the problems seem with vectors here are all the operations that i do with vectors

#include <vector>
#include <string>
#include <algorithm>

using namespace std;

typedef char myarray[9][9];
typedef string string_array[9][9];

void function2(vector<string_array>*my_3d_string_array, int d)
{
    string::iterator it;
    int j,cl;
    it=find((*my_3d_string_array)[d][j][cl].begin(),(*my_3d_string_array)[d][j][cl].end(),3);
    (*my_3d_string_array)[d][2][3].erase(it);
}

void function(vector<string_array>*my_3d_string_array, int d)
{
    (*my_3d_string_array)[d][3][4] = 2;
    function2(my_3d_string_array,d);
}

int main()
{
    myarray matrix;
    string_array string_matrix;

    std::vector<myarray>      my_3d_array;
    std::vector<string_array> my_3d_string_array;

    // fill_matrix(matrix);
    // fill_string_matrix(string_matrix)

    int d;
    function(&my_3d_string_array, d); // passing pointer to vector to a function d is the 3rd dimention

    my_3d_array.push_back(matrix);
    my_3d_string_array.push_back(string_matrix);
}

is there a stupid error i am making here?

  • 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-27T00:25:51+00:00Added an answer on May 27, 2026 at 12:25 am

    Array types are not supported as the elements in containers.

    The workaround is, probably, to use std::array<> instead of char[]

    #include <vector>
    #include <array>
    
    typedef std::array<std::array<char,4>, 6> array;
    typedef std::vector<array> _3darray; 
    
    int main()
    {
        _3darray a, b;
        a = b;
    }
    
    • g++ 4.6 likes it
    • MSVC++ 2010 doesn’t likes it too 🙂
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first winform app in .NET... I have made a couple of
I have made a little app for signing up for an event. User input
I have made a new windows service which works fine using barebone code (just
I have written a small WinForm application in C#. The EXE that is made
I have a C# 4.0 Winform app that I just upgraded from 3.5 to
I have a custom made dialog winform. On it I have a label, textbox
i want to run an application made in c# winform through service.i have done
I have a WinForm App(.Net 3.5) that we use in house for data entry...ish,
I have a winform application made up of two assemblies : a business layer
I have made a winform application for use within the company I work for(

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.