Форум программистов, компьютерный форум, киберфорум
C++/CLI Windows Forms
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.75/4: Рейтинг темы: голосов - 4, средняя оценка - 4.75
0 / 0 / 0
Регистрация: 22.03.2023
Сообщений: 2

Инициализация массива в структуре

22.03.2023, 14:14. Показов 917. Ответов 1

Студворк — интернет-сервис помощи студентам
Пытаюсь задать размер массивов внутри структуры, но выдает ошибку
error C2039: clas: не является членом "System::Array"

Структура:
C++
1
2
3
4
5
6
value struct person {
        String^ surname; // Фамилия
        array <int>^ clas; // Класс
        array <int>^ hour; // Часы
        int load; // Нагрузка
    };
Здесь выдает ошибку:
C++
1
2
man.clas = gcnew array<int> (50);
man.hour = gcnew array<int> (50);
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
#pragma once
 
namespace My49 {
 
    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;
 
value struct person {
        String^ surname; // Фамилия
        array <int>^ clas; // Класс
        array <int>^ hour; // Часы
        int load; // Нагрузка
    };
 
    /// <summary>
    /// Сводка для Form1
    /// </summary>
 
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        Form1(void)
        {
            InitializeComponent();
            //
            //TODO: добавьте код конструктора
            //
        }
 
    protected:
        /// <summary>
        /// Освободить все используемые ресурсы.
        /// </summary>
        ~Form1()
        {
            if (components)
            {
                delete components;
            }
        }
    public: System::Windows::Forms::Label^  label1;
    protected: 
    private: System::Windows::Forms::TextBox^  textBox1;
    private: System::Windows::Forms::Button^  button1;
    private: System::Windows::Forms::TextBox^  textBox2;
    private: System::Windows::Forms::TextBox^  textBox3;
    private: System::Windows::Forms::Button^  button2;
    private: System::Windows::Forms::Button^  button3;
    private: System::Windows::Forms::Button^  button4;
    private: System::Windows::Forms::Label^  label2;
    private: System::Windows::Forms::Label^  label3;
    private: System::Windows::Forms::Label^  label4;
    private: System::Windows::Forms::Label^  label5;
    private: System::Windows::Forms::Label^  label6;
    private: System::Windows::Forms::Label^  label7;
    private: System::Windows::Forms::ListBox^  listBox1;
    private: System::Windows::Forms::TextBox^  textBox4;
    private: System::Windows::Forms::Label^  label8;
    private: System::Windows::Forms::Button^  button5;
    private: System::Windows::Forms::Label^  label9;
    private: System::Windows::Forms::TextBox^  textBox5;
    private: System::Windows::Forms::TextBox^  textBox6;
 
 
 
    private: 
 
    private:
        /// <summary>
        /// Требуется переменная конструктора.
        /// </summary>
        System::ComponentModel::Container ^components;
 
#pragma region Windows Form Designer generated code
        /// <summary>
        /// Обязательный метод для поддержки конструктора - не изменяйте
        /// содержимое данного метода при помощи редактора кода.
        /// </summary>
        void InitializeComponent(void)
        {
            this->label1 = (gcnew System::Windows::Forms::Label());
            this->textBox1 = (gcnew System::Windows::Forms::TextBox());
            this->button1 = (gcnew System::Windows::Forms::Button());
            this->textBox2 = (gcnew System::Windows::Forms::TextBox());
            this->textBox3 = (gcnew System::Windows::Forms::TextBox());
            this->button2 = (gcnew System::Windows::Forms::Button());
            this->button3 = (gcnew System::Windows::Forms::Button());
            this->button4 = (gcnew System::Windows::Forms::Button());
            this->label2 = (gcnew System::Windows::Forms::Label());
            this->label3 = (gcnew System::Windows::Forms::Label());
            this->label4 = (gcnew System::Windows::Forms::Label());
            this->label5 = (gcnew System::Windows::Forms::Label());
            this->label6 = (gcnew System::Windows::Forms::Label());
            this->label7 = (gcnew System::Windows::Forms::Label());
            this->listBox1 = (gcnew System::Windows::Forms::ListBox());
            this->textBox4 = (gcnew System::Windows::Forms::TextBox());
            this->label8 = (gcnew System::Windows::Forms::Label());
            this->button5 = (gcnew System::Windows::Forms::Button());
            this->label9 = (gcnew System::Windows::Forms::Label());
            this->textBox5 = (gcnew System::Windows::Forms::TextBox());
            this->textBox6 = (gcnew System::Windows::Forms::TextBox());
            this->SuspendLayout();
            // 
            // label1
            // 
            this->label1->AutoSize = true;
            this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(204)));
            this->label1->Location = System::Drawing::Point(14, 15);
            this->label1->Margin = System::Windows::Forms::Padding(5, 0, 5, 0);
            this->label1->Name = L"label1";
            this->label1->Size = System::Drawing::Size(180, 17);
            this->label1->TabIndex = 0;
            this->label1->Text = L"Фамилия преподавателя:";
            this->label1->Visible = false;
            // 
            // textBox1
            // 
            this->textBox1->Enabled = false;
            this->textBox1->Location = System::Drawing::Point(19, 40);
            this->textBox1->Margin = System::Windows::Forms::Padding(5, 4, 5, 4);
            this->textBox1->Name = L"textBox1";
            this->textBox1->Size = System::Drawing::Size(199, 23);
            this->textBox1->TabIndex = 1;
            this->textBox1->Visible = false;
            this->textBox1->TextChanged += gcnew System::EventHandler(this, &Form1::textBox1_TextChanged);
            // 
            // button1
            // 
            this->button1->Enabled = false;
            this->button1->Location = System::Drawing::Point(228, 37);
            this->button1->Margin = System::Windows::Forms::Padding(5, 4, 5, 4);
            this->button1->Name = L"button1";
            this->button1->Size = System::Drawing::Size(101, 28);
            this->button1->TabIndex = 2;
            this->button1->Text = L"Добавить";
            this->button1->UseVisualStyleBackColor = true;
            this->button1->Visible = false;
            this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
            // 
            // textBox2
            // 
            this->textBox2->Enabled = false;
            this->textBox2->Location = System::Drawing::Point(77, 88);
            this->textBox2->Margin = System::Windows::Forms::Padding(5, 4, 5, 4);
            this->textBox2->Name = L"textBox2";
            this->textBox2->Size = System::Drawing::Size(103, 23);
            this->textBox2->TabIndex = 3;
            this->textBox2->Visible = false;
            this->textBox2->TextChanged += gcnew System::EventHandler(this, &Form1::textBox2_TextChanged);
            // 
            // textBox3
            // 
            this->textBox3->Enabled = false;
            this->textBox3->Location = System::Drawing::Point(77, 123);
            this->textBox3->Margin = System::Windows::Forms::Padding(5, 4, 5, 4);
            this->textBox3->Name = L"textBox3";
            this->textBox3->Size = System::Drawing::Size(103, 23);
            this->textBox3->TabIndex = 4;
            this->textBox3->Visible = false;
            this->textBox3->TextChanged += gcnew System::EventHandler(this, &Form1::textBox3_TextChanged);
            // 
            // button2
            // 
            this->button2->Enabled = false;
            this->button2->Location = System::Drawing::Point(190, 85);
            this->button2->Margin = System::Windows::Forms::Padding(5, 4, 5, 4);
            this->button2->Name = L"button2";
            this->button2->Size = System::Drawing::Size(101, 28);
            this->button2->TabIndex = 5;
            this->button2->Text = L"Добавить";
            this->button2->UseVisualStyleBackColor = true;
            this->button2->Visible = false;
            this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
            // 
            // button3
            // 
            this->button3->Enabled = false;
            this->button3->Location = System::Drawing::Point(190, 121);
            this->button3->Margin = System::Windows::Forms::Padding(5, 4, 5, 4);
            this->button3->Name = L"button3";
            this->button3->Size = System::Drawing::Size(101, 28);
            this->button3->TabIndex = 6;
            this->button3->Text = L"Закончить";
            this->button3->UseVisualStyleBackColor = true;
            this->button3->Visible = false;
            // 
            // button4
            // 
            this->button4->Enabled = false;
            this->button4->Location = System::Drawing::Point(66, 174);
            this->button4->Margin = System::Windows::Forms::Padding(5, 4, 5, 4);
            this->button4->Name = L"button4";
            this->button4->Size = System::Drawing::Size(165, 28);
            this->button4->TabIndex = 7;
            this->button4->Text = L"Рассчитать нагрузку";
            this->button4->UseVisualStyleBackColor = true;
            this->button4->Visible = false;
            // 
            // label2
            // 
            this->label2->AutoSize = true;
            this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(204)));
            this->label2->Location = System::Drawing::Point(14, 91);
            this->label2->Margin = System::Windows::Forms::Padding(5, 0, 5, 0);
            this->label2->Name = L"label2";
            this->label2->Size = System::Drawing::Size(51, 17);
            this->label2->TabIndex = 8;
            this->label2->Text = L"Класс:";
            this->label2->Visible = false;
            // 
            // label3
            // 
            this->label3->AutoSize = true;
            this->label3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(204)));
            this->label3->Location = System::Drawing::Point(14, 127);
            this->label3->Margin = System::Windows::Forms::Padding(5, 0, 5, 0);
            this->label3->Name = L"label3";
            this->label3->Size = System::Drawing::Size(47, 17);
            this->label3->TabIndex = 9;
            this->label3->Text = L"Часы:";
            this->label3->Visible = false;
            // 
            // label4
            // 
            this->label4->AutoSize = true;
            this->label4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(204)));
            this->label4->Location = System::Drawing::Point(14, 218);
            this->label4->Margin = System::Windows::Forms::Padding(5, 0, 5, 0);
            this->label4->Name = L"label4";
            this->label4->Size = System::Drawing::Size(178, 17);
            this->label4->TabIndex = 10;
            this->label4->Text = L"Самая большая нагрузка:";
            this->label4->Visible = false;
            // 
            // label5
            // 
            this->label5->AutoSize = true;
            this->label5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(204)));
            this->label5->Location = System::Drawing::Point(14, 239);
            this->label5->Margin = System::Windows::Forms::Padding(5, 0, 5, 0);
            this->label5->Name = L"label5";
            this->label5->Size = System::Drawing::Size(70, 17);
            this->label5->TabIndex = 11;
            this->label5->Text = L"Ковалев";
            this->label5->Visible = false;
            // 
            // label6
            // 
            this->label6->AutoSize = true;
            this->label6->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(204)));
            this->label6->Location = System::Drawing::Point(14, 279);
            this->label6->Margin = System::Windows::Forms::Padding(5, 0, 5, 0);
            this->label6->Name = L"label6";
            this->label6->Size = System::Drawing::Size(166, 17);
            this->label6->TabIndex = 12;
            this->label6->Text = L"Самая низкая нагрузка:";
            this->label6->Visible = false;
            // 
            // label7
            // 
            this->label7->AutoSize = true;
            this->label7->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(204)));
            this->label7->Location = System::Drawing::Point(14, 299);
            this->label7->Margin = System::Windows::Forms::Padding(5, 0, 5, 0);
            this->label7->Name = L"label7";
            this->label7->Size = System::Drawing::Size(62, 17);
            this->label7->TabIndex = 13;
            this->label7->Text = L"Кислер";
            this->label7->Visible = false;
            // 
            // listBox1
            // 
            this->listBox1->FormattingEnabled = true;
            this->listBox1->ItemHeight = 16;
            this->listBox1->Location = System::Drawing::Point(315, 85);
            this->listBox1->Name = L"listBox1";
            this->listBox1->Size = System::Drawing::Size(177, 228);
            this->listBox1->TabIndex = 14;
            this->listBox1->Visible = false;
            // 
            // textBox4
            // 
            this->textBox4->Location = System::Drawing::Point(224, 15);
            this->textBox4->Name = L"textBox4";
            this->textBox4->Size = System::Drawing::Size(77, 23);
            this->textBox4->TabIndex = 15;
            this->textBox4->TextChanged += gcnew System::EventHandler(this, &Form1::textBox4_TextChanged);
            // 
            // label8
            // 
            this->label8->AutoSize = true;
            this->label8->Location = System::Drawing::Point(14, 18);
            this->label8->Name = L"label8";
            this->label8->Size = System::Drawing::Size(204, 17);
            this->label8->TabIndex = 16;
            this->label8->Text = L"Количество преподавателей:";
            // 
            // button5
            // 
            this->button5->Enabled = false;
            this->button5->Location = System::Drawing::Point(160, 44);
            this->button5->Name = L"button5";
            this->button5->Size = System::Drawing::Size(141, 28);
            this->button5->TabIndex = 17;
            this->button5->Text = L"Выделить память";
            this->button5->UseVisualStyleBackColor = true;
            this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
            // 
            // label9
            // 
            this->label9->AutoSize = true;
            this->label9->Location = System::Drawing::Point(312, 65);
            this->label9->Name = L"label9";
            this->label9->Size = System::Drawing::Size(186, 17);
            this->label9->TabIndex = 18;
            this->label9->Text = L"Нагрузка преподавателей:";
            this->label9->Visible = false;
            // 
            // textBox5
            // 
            this->textBox5->Location = System::Drawing::Point(262, 290);
            this->textBox5->Name = L"textBox5";
            this->textBox5->Size = System::Drawing::Size(10, 23);
            this->textBox5->TabIndex = 19;
            this->textBox5->Visible = false;
            // 
            // textBox6
            // 
            this->textBox6->Location = System::Drawing::Point(281, 290);
            this->textBox6->Name = L"textBox6";
            this->textBox6->Size = System::Drawing::Size(10, 23);
            this->textBox6->TabIndex = 20;
            this->textBox6->Text = L"0";
            this->textBox6->Visible = false;
            // 
            // Form1
            // 
            this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->ClientSize = System::Drawing::Size(504, 327);
            this->Controls->Add(this->textBox6);
            this->Controls->Add(this->textBox5);
            this->Controls->Add(this->label9);
            this->Controls->Add(this->button5);
            this->Controls->Add(this->label8);
            this->Controls->Add(this->textBox4);
            this->Controls->Add(this->listBox1);
            this->Controls->Add(this->label7);
            this->Controls->Add(this->label6);
            this->Controls->Add(this->label5);
            this->Controls->Add(this->label4);
            this->Controls->Add(this->label3);
            this->Controls->Add(this->label2);
            this->Controls->Add(this->button4);
            this->Controls->Add(this->button3);
            this->Controls->Add(this->button2);
            this->Controls->Add(this->textBox3);
            this->Controls->Add(this->textBox2);
            this->Controls->Add(this->button1);
            this->Controls->Add(this->textBox1);
            this->Controls->Add(this->label1);
            this->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(204)));
            this->ForeColor = System::Drawing::SystemColors::ActiveCaptionText;
            this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
            this->Margin = System::Windows::Forms::Padding(5, 4, 5, 4);
            this->MaximizeBox = false;
            this->Name = L"Form1";
            this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
            this->Text = L"Задача 4.9";
            this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
            this->ResumeLayout(false);
            this->PerformLayout();
 
        }
#pragma endregion
 
private:
    array <person>^ man;
 
private: System::Void textBox4_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             if (textBox4->Text == "")
                 button5 -> Enabled = false; //Если строка пустая, то нажать кнопку нельзя
             else
                 button5 -> Enabled = true;  
         }
 
private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
             int kol = System::Convert::ToInt32(textBox4->Text);
             man = gcnew array<person> (kol);
             man.clas = gcnew array<int> (50);
             man.hour = gcnew array<int> (50);
             label8 -> Visible = false;
             textBox4 -> Visible = false;
             button5 -> Visible = false;
 
             label1 -> Visible = true;
             label2 -> Visible = true;
             label3 -> Visible = true;
             label4 -> Visible = true;
             label5 -> Visible = true;
             label6 -> Visible = true;
             label7 -> Visible = true;
             textBox1 -> Visible = true;
             textBox2 -> Visible = true;
             textBox3 -> Visible = true;
             button1 -> Visible = true;
             button2 -> Visible = true;
             button3 -> Visible = true;
             button4 -> Visible = true;
             listBox1 -> Visible = true;
             textBox1 -> Enabled = true;
             ClientSize = System::Drawing::Size(510, 356);
         }
private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
 
             if (textBox1->Text == "")
                 button1 -> Enabled = false; //Если строка пустая, то нажать кнопку нельзя
             else
                 button1 -> Enabled = true; 
                 label5->Text = ""; //При изменении текста исчезает ответ
                 label7->Text = "";
         }
private: System::Void textBox2_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             if (textBox2->Text == "" || textBox3->Text == "")
                 button2 -> Enabled = false; //Если строка пустая, то нажать кнопку нельзя
             else
                 button2 -> Enabled = true; 
             label5->Text = ""; //При изменении текста исчезает ответ
         }
private: System::Void textBox3_TextChanged(System::Object^  sender, System::EventArgs^  e) {
             if (textBox2->Text == "" || textBox3->Text == "")
                 button2 -> Enabled = false; //Если строка пустая, то нажать кнопку нельзя
             else
                 button2 -> Enabled = true; 
             label5->Text = ""; //При изменении текста исчезает ответ         
         }
private: System::Void button3_Click(System::Object^  sender, System::EventArgs^  e) {
             textBox1->Text = "";
             textBox1 -> Enabled = true;
             textBox2 -> Enabled = false;
             button2 -> Enabled = false;
             textBox3 -> Enabled = false;
             button3 -> Enabled = false;
             button4 -> Enabled = true;
         }
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
             button4 -> Enabled = false;
             textBox1 -> Enabled = false;
             button1 -> Enabled = false;
             textBox2 -> Enabled = true;
             button3 -> Enabled = true;
             textBox3 -> Enabled = true;
             listBox1->Items->Add( textBox1->Text );
             man[Convert::ToInt32(textBox6 -> Text)].surname =  textBox1->Text;
             textBox5 -> Text = "0";
             textBox6 -> Text = Convert::ToString( Convert::ToInt32(textBox6->Text) + 1 );
         }
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
             ClientSize = System::Drawing::Size(325, 80);
         }
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
             man[Convert::ToInt32(textBox6 -> Text)].clas[Convert::ToInt32(textBox5->Text)] = Convert::ToInt32(textBox2->Text);
             man[Convert::ToInt32(textBox6 -> Text)].hour[Convert::ToInt32(textBox5->Text)] = Convert::ToInt32(textBox3->Text);
             textBox2->Text = "";
             textBox3->Text = "";
             button2 -> Enabled = false;
         }
};
}
Не понимаю в чем ошибка, точно так же задал массив структуры сверху и не выдавало ошибку
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
22.03.2023, 14:14
Ответы с готовыми решениями:

Инициализация массива в структуре
Есть Делфи код: type S100 = string; PointRec = record i:word; c:longint; d:char; end; end; ...

Инициализация массива в структуре
Переписываю код из C++ на C#, столкнулся с такой проблемой инициализации. Если в C++ можно было сделать так: struct solut { ...

Инициализация массива char'ов в структуре
Вот создал такую структуру struct ubs { //Конструктор с параметрами по умолчанию ubs( char...

1
0 / 0 / 0
Регистрация: 22.03.2023
Сообщений: 2
27.03.2023, 21:19  [ТС]
Нашел ошибку.
Я создаю массив структур и когда пытаюсь инициализировать массив элементов внутри структуры мне нужно обратиться сначала к номеру массива со структурами, а потом к элементу структуры

C++
1
2
man[0].clas = gcnew array<int>(50);
man[0].hour = gcnew array<int>(50);
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
27.03.2023, 21:19
Помогаю со студенческими работами здесь

Инициализация статического массива в структуре
Здравствуйте, Подскажите пожалуйста, вот есть статический массив int`ов: int my_int1 = {1,2,3,4,5,6}; А вот есть структура...

Инициализация в структуре
const int len=30; const int size=5; struct stud { char name= &quot;Olga Mironova&quot;, &quot;Mihail Mihailov&quot;, &quot;Vladimir...

Инициализация объектов в структуре
Нужно с помощью структуры создавать несколько объектов LabeledEdit и ComboBox, вопрос в том как и где инициализировать объекты , попробовал...

Инициализация структуры в структуре
Доброе время суток, дамы и господа! Хочу построить ступенчатый массив Как инициализировать массив структур в структуре? Есть структура ...

Инициализация полей в структуре
#include &lt;iostream&gt; #include &lt;string.h&gt; #include &lt;stdio.h&gt; #include &lt;conio.h&gt; #include &lt;stdlib.h&gt; using namespace std; struct...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
2
Ответ Создать тему
Новые блоги и статьи
1С: Контроль уникальности заводского номера
Maks 23.03.2026
Алгоритм контроля уникальности заводского (или серийного) номера на примере документа выдачи шин для спецтехники с табличной частью. Данные берутся из регистра сведений, по которому настроено. . .
Хочу заставить корпорации вкладываться в здоровье сотрудников: делаю мат модель здравосохранения
anaschu 22.03.2026
e7EYtONaj8Y Z4Tv2zpXVVo https:/ / github. com/ shumilovas/ med2. git
1С: Программный отбор элементов справочника по группе
Maks 22.03.2026
Установка программного отбора элементов справочника "Номенклатура" из модуля формы документа. В качестве фильтра для отбора справочника служит группа номенклатуры. Отбор по наименованию группы. . .
Как я обхитрил таблицу Word
Alexander-7 21.03.2026
Когда мигает курсор у внешнего края таблицы, и нам надо перейти на новую строку, а при нажатии Enter создается новый ряд таблицы с ячейками, то мы вместо нервных нажатий Энтеров мы пишем любые буквы. . .
Krabik - рыболовный бот для WoW 3.3.5a
AmbA 21.03.2026
без регистрации и смс. Это не торговля, приложение не содержит рекламы. Выполняет свою непосредственную задачу - автоматизацию рыбалки в WoW - и ничего более. Однако если админы будут против -. . .
1С: Программный отбор элементов справочника по значению перечисления
Maks 21.03.2026
Установка программного отбора элементов справочника "Сотрудники" из модуля формы документа. В качестве фильтра для отбора служит значение перечислений. / / Событие "НачалоВыбора" реквизита на форме. . .
Переходник USB-CAN-GPIO
Eddy_Em 20.03.2026
Достаточно давно на работе возникла необходимость в переходнике CAN-USB с гальваноразвязкой, оный и был разработан. Однако, все меня терзала совесть, что аж 48-ногий МК используется так тупо: просто. . .
Оттенки серого
Argus19 18.03.2026
Оттенки серого Нашёл в интернете 3 прекрасных модуля: Модуль класса открытия диалога открытия/ сохранения файла на Win32 API; Модуль класса быстрого перекодирования цветного изображения в оттенки. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru