-
February 2nd, 2012, 12:24 PM
#1
Is 2D cliext::vector myth ??
Hi ,
This is my first post to CodeGuru. I have been seeking for a 2D cliext::vector decleration for a long long time, i found nothing ! I saw that some other people are looking for the same subject. However i am not sure that even they exist or not?
Any help will be greatly appreciated.
PS. I have some cliext::vector syntax which are working fine. Finally i need a 2d vector , if it really exists.
#include <cliext/vector>
using namespace cliext
vector<int^>^vec = gcnew vector<int^>(9) ;
vect->push_back(7) ;
vect->pop_back(7);
vec->erase(vec->begin()+3) ; // delete 3rd vector members
vec->eraser(vec->begin(),vec->begin()+3) ; // delete first 3 member
vec->size(); // new size
-
February 2nd, 2012, 12:30 PM
#2
Re: Is 2D cliext::vector myth ??
Originally Posted by ey_dsl
Hi ,
This is my first post to CodeGuru.
You posted your question in the wrong forum.
Your code is Managed C++, not ANSI C++ using the Visual C++ compiler.
Code:
vector<int^>^vec = gcnew vector<int^>(9) ;
That code is gibberish here, but it makes sense in the Managed C++ forum.
Regards,
Paul McKenzie
-
February 2nd, 2012, 01:33 PM
#3
Re: Is 2D cliext::vector myth ??
Is there a managed c++ forum ?
-
February 2nd, 2012, 01:39 PM
#4
Re: Is 2D cliext::vector myth ??
Originally Posted by ey_dsl
Is there a managed c++ forum ?
http://www.codeguru.com/forum/forumdisplay.php?f=17
Regards,
Paul McKenzie
-
February 2nd, 2012, 01:46 PM
#5
Re: Is 2D cliext::vector myth ??
-
February 3rd, 2012, 06:25 PM
#6
Re: Is 2D cliext::vector myth ??
There is always a work-around. You can try this as well . . .
Code:
#include <vector>
using namespace std;
typedef vector<int> vec; // or whatever the type you like
typedef vector<vec> vec_vec
typedef vec::iterator _vec;
typedef vec_vec::iterator _vec_vec;
A vector of vectors will give you the same results. Each vector can then contain two or more of whatever - the big iterator is for walking the vector of vectors, and the little iterator is for walking the individual vectors as you access them.
Perfect Health and Clarity of Mind,
--Victor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|