473,320 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Multidimensional vector in c++

Hi,

I want to delete a column of a 2-dimensional vector using erase.
Actually the array is dynamic both row and column wise,so i opt for vector, now i want to delete using erase,
Expand|Select|Wrap|Line Numbers
  1. vector<vector <int>>::iterator ptr1;
  2. vector<int>::iterator ptr2,ptr3;
  3. vector<int> cr1;
  4. vector<vector<int>> c2;
  5.  
  6.     ptr3=cr1.begin();
  7.     while(ptr3 != cr1.end())
  8.     {
  9.           ptr1=c2.begin();
  10.          while(ptr1!=c2.end())
  11.         {
  12.  
  13.              ptr2=(*ptr1).begin();
  14.              while (ptr2!=(*ptr1).end())
  15.             { 
  16.               if ( (*ptr2)== (*ptr3))
  17.                {
  18.                                     c2.erase(....... );
  19.       break;
  20.       break;
  21.               }
  22.      ptr2++;
  23.  
  24.             }
  25.      ptr1++;
  26.       }
  27.       ptr3++;
  28. }
  29.  
Please help.What should i fill in ......
Mar 7 '08 #1
1 2797
sicarie
4,677 Expert Mod 4TB
That sounds like a great question to ask Google.
Mar 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Nils Grimsmo | last post by:
i always have trouble explaining why creation of multidimensional lists is not as straight forward as it could be in python. list comprehensions are ugly if you are new to the language. i really...
4
by: James | last post by:
What's the best way of dynamically allocating a multidim array from the following: int **a = new int*; a = new int; .... and so on or: int (*a) = new int;
3
by: Peter L. | last post by:
It would be great if someone could give me a hint for my problem. I create a multidimensional array: vector< vector<string> > applications; and then I want to write into it. applications...
21
by: utab | last post by:
Hi there, Is there a way to convert a double value to a string. I know that there is fcvt() but I think this function is not a part of the standard library. I want sth from the standard if...
0
by: nabh | last post by:
hi, i want to know how to declare multidimensional vectors in visual c++. ex: vector<vector<string>> variable; is this the way to declare a multidimensional vector variable?
5
by: asdf | last post by:
I was told not to use the low-level language such as arrays which inherited from C, I want to know what can I use to substitute the C-style multidimensional arrays? Is there multidimensional vector?
7
by: Markus Pitha | last post by:
Hello again, I have another question about the handling of multidimensional vectors. Actually, it's not difficult when the size is known at the beginning, but I still wasn't able to create...
1
by: Szabolcs Borsanyi | last post by:
The following code compiles with a warning message: passing arg 1 of `use_vector' from incompatible pointer type How can one correctly pass a multidimensional array (by reference) expressing...
9
by: Slain | last post by:
I need to convert a an array to a multidimensional one. Since I need to wrok with existing code, I need to modify a declaration which looks like this In the .h file int *x; in a initialize...
5
by: rottmanj | last post by:
I am trying to build a multidimensional vector array that allows for multiple child elements under each parent element, but I am having a heck of a time trying to figure out how to do it. Right...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.