23.12.2013, 19:06. Просмотров 502. Ответов 15
Свой код писал по примеру
cut.
Вот, что есть, и показываю скрин екхепшана, который выбрасывается. Кто-нибудь может помочь разобраться в чем ошибка? Ошибка в строке 55, что-то неправильное происходит при передаче в метод insert.
C++ |
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
58
59
60
61
62
63
64
65
| #include "stdafx.h"
#include <iostream>
#include <locale>
#include <conio.h>
#include <iomanip>
#include <map>
int count = 0;
map<int, Visitor> mapVisitor;
class Visitor
{
private:
struct VisitorTime
{
char *timeArrival; // время прихода
char *timeCare; // время ухода
VisitorTime(char *timeArrival, char *timeCare)
{
this->timeArrival = timeArrival;
this->timeCare = timeCare;
}
};
VisitorTime *vTime;
int id;
public:
Visitor(char *timeArrival, char *timeCare, int id)
{
vTime = new VisitorTime(timeArrival, timeCare);
this->id = id;
}
~Visitor()
{
delete vTime;
}
};
inline void addVisitor()
{
char timeArrival[50] = {'\0'};
char timeCare[50] = {'\0'};
cout<<"Добавляем "<<(count+1)<<" посетителя"<<endl;
cout<<"Ввод времени прихода в формате: 'часы минуты': ";
gets(timeArrival);
cout<<"Ввод времени прихода в формате: 'часы минуты': ";
gets(timeCare);
Visitor visitor(timeArrival, timeCare, count);
mapVisitor.insert(pair<int, Visitor>(count, visitor));
}
int _tmain(int argc, _TCHAR* argv[])
{
setlocale(LC_ALL,"RUSSIAN");
addVisitor();
getch();
} |
|