Bonjour,
voilà j'ai un code qui plante à la sortie de la fonction et je ne comprends pas pourquoi.
Est ce que quelqu'un aurait une idée du problème ?
Je pense que c'est l'utilisation du vecteur 2D mais je ne comprends pas pourquoi.
Voilà le code qui plante
Merci d'avance à celui qui trouvera !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 #include <stdio.h> #include <stdlib.h> #include <vector> typedef struct { int x; int y; } CvPoint ; typedef struct { CvPoint Point; int imgIndex; int Month,Day,Hour,Minute; int iSize; } OBJECT; bool test(); int main() { test(); return 0; } bool test() { std::vector< std::vector< OBJECT > > vectObjects; // all detected objects std::vector< OBJECT > vObjects; // all detected objects OBJECT object; for (int k = 0; k<3000 ;k++) { for (int i = 0; i<3000 ;i++) { object.Day = 20; object.Minute = 1; vObjects.push_back(object); } vObjects.push_back(object); vectObjects.push_back(vObjects); vObjects.clear(); if (k%500==200) vectObjects.clear(); } vObjects.~vector(); vectObjects.~vector(); // pb ici return 0; }
Partager