Форум программистов, компьютерный форум CyberForum.ru

Потоки. Event. Задача про обедающих философов. - C++

Войти
Регистрация
Восстановить пароль
Другие темы раздела
C++ Контрольная http://www.cyberforum.ru/cpp-beginners/thread549459.html
Помогите с контрольной пожалуйста Задание
C++ Итератор для списка #include <iostream> using namespace std; template <class T> class Link { public: T value; Link *nextLink; Link( T v, Link<T>* n ) : value ( v ), nextLink ( n ) {} }; http://www.cyberforum.ru/cpp-beginners/thread549447.html
Запуск программы с удаленного сервера C++
Допустим мы запускаем у себя программу, лежащюю на удаленном сервере(не наша подсеть) и в процессе своей работы программа обращается к IP 10.1.10.1 Вопрос: программа обратится к этому адресу в подсети сервера, или клиента?
C++ Делаю сапёр. что тут не так????
#include<iostream.h> #include<dos.h> #include<time.h> #include<stdio.h> #include<stdlib.h> #include<conio.h> int main (void) {
C++ Не могу найти ошибку http://www.cyberforum.ru/cpp-beginners/thread549429.html
Добрый день. Есть код #include <stdio.h> #include <conio.h> #include <math.h> struct tbook {
C++ Итерационный метод удаления бинарного дерева Есть бинарное дерево поиска нужно создать итерационный метод удаления дерева. Вот есть функция удаления дерева но при удалении происходит ошибка вот такая: Необработанное исключение в "0x64bd12b4" в "Derevo.exe": 0xC0000005: Нарушение прав доступа при чтении "0xfeeefee8". и указивает на free(node->left); typedef struct tag_tree{ int info; struct tag_tree *left, *right; }TREE; void... подробнее

Показать сообщение отдельно
kravam
быдлокодер
1694 / 881 / 44
Регистрация: 04.06.2008
Сообщений: 5,441
16.04.2012, 13:13
ОК, попробуем потестить
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
++++++++++++++++++
Philosopher[2] want to eat.
Try to cath forks.
Left[2] and right[3] forks - Philosopher[3] want to eat.
Philosopher[3] want to eat.
Philosopher[4] want to eat.
Try to cath forks.
Left[4] and right[5] forks - Try to cath forks.
Try to cath forks.
Left[3] and right[4] forks - Philosopher[5] want to eat.
Philosopher[7] want to eat.
Philosopher[6] want to eat.
Try to cath forks.
Left[6] and right[7] forks - Try to cath forks.
Left[5] and right[6] forks - Left[3] and right[4] forks - Philosopher[9] want to
 eat.
Philosopher[8] want to eat.
Try to cath forks.
Try to cath forks.
Left[9] and right[10] forks - failed.
Philosopher[9] want to eat.
Try to cath forks.
Left[9] and right[10] forks - Try to cath forks.
Left[8] and right[9] forks - Left[7] and right[8] forks - failed.
failed.
failed.
failed.
failed.
failed.
failed.
failed.
failed.
Philosopher[2] THINKING.
Philosopher[9] THINKING.
Philosopher[3] THINKING.
Philosopher[4] THINKING.
Philosopher[5] THINKING.
Philosopher[9] THINKING.
Philosopher[3] THINKING.
Philosopher[6] THINKING.
Philosopher[7] THINKING.
Philosopher[8] THINKING.
Philosopher[2] want to eat.
Try to cath forks.
Left[2] and right[3] forks - Philosopher[4] want to eat.
Philosopher[9] want to eat.
Philosopher[3] want to eat.
Try to cath forks.
Try to cath forks.
Try to cath forks.
Left[4] and right[5] forks - Left[9] and right[10] forks - Left[3] and right[4]
forks - Philosopher[5] want to eat.
Philosopher[9] want to eat.
Try to cath forks.
Try to cath forks.
Left[5] and right[6] forks - Left[9] and right[10] forks - failed.
Philosopher[3] want to eat.
Try to cath forks.
Left[3] and right[4] forks - failed.
Philosopher[6] want to eat.
Philosopher[8] want to eat.
Philosopher[7] want to eat.
failed.
Try to cath forks.
Try to cath forks.
Try to cath forks.
Left[6] and right[7] forks - Left[8] and right[9] forks - Left[7] and right[8] f
orks - failed.
failed.
failed.
failed.
failed.
failed.
failed.
Philosopher[9] THINKING.
Philosopher[9] THINKING.
Philosopher[2] THINKING.
Philosopher[4] THINKING.
Philosopher[3] THINKING.
Philosopher[5] THINKING.
Philosopher[3] THINKING.
Philosopher[7] THINKING.
Philosopher[6] THINKING.
Philosopher[8] THINKING.
Philosopher[9] want to eat.
Try to cath forks.
Left[9] and right[10] forks - Philosopher[2] want to eat.
Philosopher[9] want to eat.
Try to cath forks.
Try to cath forks.
Left[2] and right[3] forks - Left[9] and right[10] forks - Philosopher[4] want t
o eat.
Try to cath forks.
Left[4] and right[5] forks - Philosopher[3] want to eat.
failed.
Try to cath forks.
Left[3] and right[4] forks - Philosopher[5] want to eat.
failed.
Try to cath forks.
Left[5] and right[6] forks - Philosopher[3] want to eat.
Try to cath forks.
Left[3] and right[4] forks - Philosopher[7] want to eat.
failed.
Philosopher[6] want to eat.
Philosopher[8] want to eat.
Try to cath forks.
Try to cath forks.
Try to cath forks.
Left[7] and right[8] forks - Left[6] and right[7] forks - Left[8] and right[9] f
orks - failed.
failed.
failed.
failed.
failed.
failed.
failed.
Philosopher[9] THINKING.
Philosopher[9] THINKING.
Philosopher[2] THINKING.
Philosopher[3] THINKING.
Philosopher[4] THINKING.
Philosopher[5] THINKING.
Philosopher[3] THINKING.
Philosopher[6] THINKING.
Philosopher[7] THINKING.
Philosopher[8] THINKING.
Philosopher[9] want to eat.
Try to cath forks.
Left[9] and right[10] forks - Philosopher[9] want to eat.
Try to cath forks.
Left[9] and right[10] forks - failed.
Philosopher[2] want to eat.
failed.
Try to cath forks.
Left[2] and right[3] forks - Philosopher[4] want to eat.
Philosopher[3] want to eat.
Try to cath forks.
Try to cath forks.
Left[4] and right[5] forks - Left[3] and right[4] forks - Philosopher[5] want to
 eat.
Try to cath forks.
Left[5] and right[6] forks - Philosopher[3] want to eat.
Try to cath forks.
Left[3] and right[4] forks - failed.
Philosopher[7] want to eat.
Philosopher[8] want to eat.
Philosopher[6] want to eat.
Try to cath forks.
Try to cath forks.
Try to cath forks.
Left[7] and right[8] forks - Left[8] and right[9] forks - Left[6] and right[7] f
orks - failed.
failed.
failed.
failed.
failed.
failed.
failed.
Philosopher[9] THINKING.
Philosopher9 exiting the program.
Philosopher[9] THINKING.
Philosopher9 exiting the program.
Philosopher[2] THINKING.
Philosopher2 exiting the program.
Philosopher[3] THINKING.
Philosopher[4] THINKING.
Philosopher3 exiting the program.
Philosopher4 exiting the program.
Philosopher[5] THINKING.
Philosopher5 exiting the program.
Philosopher[3] THINKING.
Philosopher3 exiting the program.
Philosopher[6] THINKING.
Philosopher[7] THINKING.
Philosopher[8] THINKING.
Philosopher6 exiting the program.
Philosopher7 exiting the program.
Philosopher8 exiting the program.
Меня смущает одна вещь; насколько я понял философов 10, но что-то я не наблюдаю действия 0-го философа
 
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Рейтинг@Mail.ru