std ::vector [erreur que je ne comprend pas]
bonjour,
je veux creer un vector à deux dimensions.
j'ai récupérer ce code dans un tutorial
Code:
1 2 3 4 5 6 7 8 9 10 11
| #include <vector>
int main ()
{
int M = 3,
N = 4;
std::vector< std::vector<int> >Vecteur2D;
Vecteur2D.resize (M);
for (int i = 0; i < M; i++)
Vecteur2D[i].resize (N);
// utiliser Vecteur2D...
} |
j'obitens cette erreur
Code:
[C++ Erreur] vector.cc(71): E2015 Ambiguïté entre 'std::vector<int,std::allocator<int> >::insert(int *,int,int)' et 'std::vector<int,std::allocator<int> >::insert(int *,unsigned int,const int &)'
Je comprend pas pourquoi ça ne marche pas. J'ai Borland C++ 4 Professional
bug de borland c++ builder 4
voila ce que en dit Borland
Citation:
Area: rtl\c++\stl
Reference Number: 189
Status: Open
Date Reported: 1/2/99
Severity: Commonly Encountered
Type: Basic Functionality Failure
Problem:
std::vector.resize(...) doesn't work w/ vector < int
> 's
--
the following code:
#include < vector >
..
std::vector < int > SomeVector;
SomeVector.resize(10);
yields the following compile error:
[C++ Error] vector.cc(71): E2015 Ambiguity
between 'std::vector < int,std::allocator < int >
> ::insert(int *,int,int)' and 'std::vector <
int,std::allocator < int > > ::insert(int *,unsigned
int,const int &)'.
il n'ya pas de solution proposée donc je vais faire un vector de double qui stockera des entiers :lol: