Home > Back-end >  Bizarre BCB environment problem, the great god to solve!
Bizarre BCB environment problem, the great god to solve!

Time:09-27

Everybody is good, BCB environment, there is a vector, element is a structure, structure and a vector in the body, this will be a problem? Some people actually used?
Assignment will appear the push_back (), element, access error, is very confused, vs below won't appear this kind of problem, solving!

CodePudding user response:

No, there is short code, help you to verify

CodePudding user response:

This should be no problem, the problem of possible or you program
The following is my test
# include & lt; iostream>
# include & lt; Vector>
using namespace std;
Struct TEST {
The vector & lt; int> x;
int y;
};
Int main ()
{
The vector & lt; TEST> test;
The TEST m;
M.X.P ush_back (10);
M.y=20.
Test. The push_back (m);
cout cout return 0;
}



CodePudding user response:

refer to the second floor keiy response:
this should be no problem, may be the problem or question you program
The following is my test
# include & lt; iostream>
# include & lt; Vector>
using namespace std;
Struct TEST {
The vector & lt; int> x;
int y;
};
Int main ()
{
The vector & lt; TEST> test;
The TEST m;
M.X.P ush_back (10);
M.y=20.
Test. The push_back (m);
cout cout return 0;
}

Thank you oh, I started this with no problem, then use problems, access to the inside of the element will be an error, colleagues also encounter this problem
  • Related