This is a beta test code of the algorithm Malgrange, I need to create array Y1 from C0... (Y1 = C0 - X0)
#include <iostream>
using namespace std;
int main()
{
// create array C0
string** masiv_C0=new string*[3];
for (int i=0;i<3;i++)
masiv_C0[i]=new string [2];
masiv_C0[0][0]="AB";
masiv_C0[0][1]="C";
masiv_C0[1][0]="X";
masiv_C0[1][1]="Z";
masiv_C0[2][0]="XY";
masiv_C0[2][1]="ZQ";
//create array X0
string** masiv_X0=new string*[1];
masiv_X0[i]=new string [2];
masiv_X0[0][0]="X";
masiv_X0[0][1]="Z";
//create array Y1 = C0 - X0 (remove from C0 elements X0)
bool flag;
string** masiv_Y1=new string*[3];
for (int i=0;i<3;i++)
masiv_Y1[i]=new string [2];
for (int i=0;i<3;i++)
{
flag=true;
for (int j=0;j<3;j++)
{
if ((masiv_C0[i][0]==masiv_X0[j][0])&&(masiv_C0[i][1]==masiv_X0[j][1]))
{
flag=false;
break;
}
}
if (flag)
{
masiv_Y1[i][0]=masiv_C0[i][0];
masiv_Y1[i][1]=masiv_C0[i][0];
}
}
for (int i=0;i<3;i++)
{
for (int j=0;j<2;j++)
{
cout<<masiv_Y1[i][j];
}
cout<<endl<<endl;
}}
Of course the algorithm is not finalized and most of the code is not here, but the problem is this error, I can not create an array without the elements that are contained in a subset of the other elements