IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++ Discussion :

Problème et AVC : _wfopen_s


Sujet :

C++

  1. #61
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Exemple :
    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
    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
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    // int afficher_OK()
    const int Cinema::afficher_OK()
    { // OK !
    	int i = 0, j, Y, I; // , j;
    	HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    	DWORD dwMode = 0;
    	dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
    	CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
    	GetConsoleScreenBufferInfo(hOut, &csbiInfo);
    	Y = csbiInfo.srWindow.Right + 1;
    	//
    	vector <wstring>::iterator iter;
    	basic_string <wchar_t>::size_type pos;
    	wstring wstr;
    	wstring Textes, textes;
    	wchar_t date_string[22];
    	//
    	::Console_Lire_txt(L"---------- ", Y);
    	wcout << L'{' << Ok << L'}' << endl;
    	::Console_Lire_txt(L"---------- ", Y);
    	// Titre
    	bool titre_ = false;
    	i = (int)Titre.size();
    	iter = Titre.begin();
    	Textes = L"Titre : " + *iter;
    	textes = L"¬¬¬¬¬ ¬ " + *iter;
    	if (i == 3 || i == 4)
    	{
    		iter++;
    		if (*iter == L"")
    			;		else
    		{
    			if (*iter == L" : ")
    			{
    				Textes += L" : ";
    				textes += L" ¬ ";
    			}
    			else if (*iter == L": ")
    			{
    				Textes += L": ";
    				textes += L"¬ ";
    			}
    			else
    			{
    				Textes += L'/';
    				textes += L'¬';
    			}
    			iter++;
    			Textes += *iter;
    			textes += *iter;
    		}
    		if (i == 4)
    			titre_ = true;
    	}
    	// Sur
    	if (Sur_ == true)
    	{
    		Textes += L" (" + Sur + L')';
    		textes += L" ¬" + Sur + L'¬';
    	}
    	// En salle
    	else
    	{
    		Textes += L" (en salle)";
    		textes += L" ¬en salle¬";
    	}
    	// La signalétique jeunesse
    	if (SJ_ == true)
    	{
    		Textes += L" (" + SJ + L')';
    		textes += L" ¬" + SJ + L'¬';
    	}
    	// Netflix SJ
    	if (Netflix_SJ_ == true)
    	{
    		Textes += L" [" + Netflix_SJ + L']';
    		textes += L" ¬" + Netflix_SJ + L'¬';
    	}
    	if (Date_ == true)
    	{
    		wcsftime(date_string, 15, L"%d/%m/%Y", &Date);
    		wstr = date_string;
    		Textes += L' ' + wstr.substr(0, 2) + L'/' + wstr.substr(3, 2) + L'/' + wstr.substr(6, 4);
    		textes += L' ' + wstr.substr(0, 2) + L'¬' + wstr.substr(3, 2) + L'¬' + wstr.substr(6, 4);
    	}
    	// Temps
    	if (Temps_ == true)
    	{
    		Textes += L' ';
    		textes += L' ';
    		if (Temps.tm_hour != 0)
    		{
    			wcsftime(date_string, 3, L"%H", &Temps);
    			wstr = date_string;
    			wstr = wstr.substr(1);
    			Textes += wstr + L'h';
    			textes += wstr + L'¬';
    		}
    		if (Temps.tm_min == 60 && Temps.tm_hour == 0)
    		{
    			Textes +=L"60min";
    			textes +=L"60¬¬¬";
     
    		}
    		else if (Temps.tm_hour == 0)
    		{
    			wcsftime(date_string, 3, L"%M", &Temps);
    			wstr = date_string;
    			Textes.append(wstr + L"min");
    			textes.append(wstr + L"¬¬¬");
    		}
    		else
    		{
    			wcsftime(date_string, 3, L"%M", &Temps);
    			Textes += date_string;
    			textes += date_string;
    		}
    	}
    	i = ::Console_Lire_txt(Textes, textes, 0, 8, Y, C_T, C_t);
    	// Distributeur
    	if (Distributeur_ == true)
    	{
    		i = ::Console_Lire_txt(
    			L"Distributeur : " + Distributeur,
    			L"¬¬¬¬¬¬¬¬¬¬¬¬ ¬ " + Distributeur,
    			0, 15, Y, C_T, C_t);
    	}
    	// Date de reprise
    	if (Date_de_reprise_ == true)
    	{
    		wcsftime(date_string, 18, L"%d/%m/%Y", &Date_de_reprise);
    		wstr = date_string;
    		i = ::Console_Lire_txt(
    			L"Date de reprise : " + wstr.substr(0, 2) + L'/' + wstr.substr(3, 2) + L'/' + wstr.substr(6, 4),
    			L"¬¬¬¬ ¬¬ ¬¬¬¬¬¬¬ ¬ " + wstr.substr(0, 2) + L'¬' + wstr.substr(3, 2) + L'¬' + wstr.substr(6, 4),
    			0, 19, Y, C_T, C_t);
    	}
    	// Date de sortie
    	if (Date_de_sortie_ != 0)
    	{
    		wcsftime(date_string, 14, L"%d/%m/%Y", &Date_de_sortie);
    		wstr = date_string;
    		i = ::Console_Lire_txt(
    			L"Date de sortie : " + wstr.substr(0, 2) + L'/' + wstr.substr(3, 2) + L'/' + wstr.substr(6, 4),
    			L"¬¬¬¬ ¬¬ ¬¬¬¬¬¬ ¬ " + wstr.substr(0, 2) + L'¬' + wstr.substr(3, 2) + L'¬' + wstr.substr(6, 4),
    			0, 18, Y, C_T, C_t);
    	}
    	// Titre original
    	if (Titre_Original_ == true)
    	{
    		iter = Titre_Original.begin();
    		Textes = L"Titre original : " + *iter;
    		textes = L"¬¬¬¬¬ ¬¬¬¬¬¬¬¬ ¬ " + *iter;
    		if (Titre_Original.size() == 3)
    		{
    			iter++;
    			wstr = *iter;
    			i = 0;
    			while (i < wstr.length())
    			{
    				Textes += wstr[i];
    				textes += L'¬';
    				i++;
    			}
    			iter++;
    			Textes += *iter;
    			textes += *iter;
    		}
    		i = ::Console_Lire_txt(Textes, textes, 0, 17, Y, C_T, C_t);
    	}
    	// Français - Audiodescription
    	if (AD != L"")
    	{
    		pos = AD.find(L" - ");
    		i = ::Console_Lire_txt(
    			L"AD : " + AD.substr(0, pos) + L" - " + AD.substr(pos + 3),
    			L"¬¬ ¬ " + AD.substr(0, pos) + L"¬¬¬" + AD.substr(pos + 3),
    			0, 6, Y, C_T, C_t);
    	}
    	// Gense(s)
    	if (Gense_ == true)
    	{
    		Textes = L"Gense";
    		textes = L"¬¬¬¬¬";
    		j = 8;
    		if (Gense.size() > 1)
    		{
    			Textes += L's';
    			textes += L'¬';
    			j = 9;
    		}
    		Textes += L" : ";
    		textes += L" ¬ ";
    		i = 0;
    		for (iter = Gense.begin(); iter != Gense.end(); iter++)
    		{
    			Textes += *iter;
    			textes += *iter;
    			if (i < Gense.size() - 1)
    			{
    				Textes += L", ";
    				textes += L"¬ ";
    			}
    			i++;
    		}
    		i = ::Console_Lire_txt(Textes, textes, 0, j, Y, C_T, C_t);
    	}
    	// De
    	if (De_ == true)
    	{
    		Textes = L"De";
    		textes = L"¬¬";
    		j = 6;
    		if (De.size() > 1)
    		{
    			Textes += L's';
    			textes += L'¬';
    			j = 7;
    		}
    		Textes += L" : ";
    		textes += L" ¬ ";
    		i = 0;
    		for (iter = De.begin(); iter != De.end(); iter++)
    		{
    			Textes += *iter;
    			textes += *iter;
    			if (i < De.size() - 1)
    			{
    				Textes += L", ";
    				textes += L"¬ ";
    			}
    			i++;
    		}
    		i = ::Console_Lire_txt(Textes, textes, 0, j, Y, C_T, C_t);
    	}
    	// Par
    	if (Par_ == true)
    	{
    		Textes = L"Par : ";
    		textes = L"¬¬¬ ¬ ";
    		i = 0;
    		for (iter = Par.begin(); iter != Par.end(); iter++)
    		{
    			Textes += *iter;
    			textes +=  *iter;
    			if (i < Par.size() - 1)
    			{
    				Textes += L", ";
    				textes += L"¬ ";
    			}
    			i++;
    		}
    		i = ::Console_Lire_txt(Textes, textes, 0, 7, Y, C_T, C_t);
    	}
    	// Avec
    	if (Avec_ == true)
    	{
    		Textes = L"Avec : ";
    		textes = L"¬¬¬¬ ¬ ";
    		i = 0;
    		for (iter = Avec.begin(); iter != Avec.end(); iter++)
    		{
    			Textes += *iter;
    			textes += *iter;
    			if (i < Avec.size() - 1)
    			{
    				Textes += L", ";
    				textes += L"¬ ";
    			}
    			i++;
    		}
    		i = ::Console_Lire_txt(Textes, textes, 0, 7, Y, C_T, C_t);
    	}
    	// Nationalite(s)
    	Textes = L"Nationalite";
    	textes = L"¬¬¬¬¬¬¬¬¬¬¬";
    	j = 14;
    	if (Nationalite.size() > 1)
    	{
    		Textes += L's';
    		textes += L'¬';
    		j = 15;
    	}
    	Textes += L" : ";
    	textes += L" ¬ ";
    	if (Nationalite_ == true)
    	{
    		for (iter = Nationalite.begin(), i = 0; iter != Nationalite.end(); iter++, i++)
    		{
    			Textes += *iter;
    			textes += *iter;
    			if (i < Nationalite.size() - 1)
    			{
    				Textes += L", ";
    				textes += L"¬ ";
    			}
    		}
    	}
    	if (Mm_ == true)
    	{
    		Textes += L' ';
    		textes += L' ';
    	}
    	// Mm
    	if (Mm_ == true)
    	{
    		Textes += L'(' + Mm + L')';
    		textes += L'¬' + Mm + L'¬';
    	}
    	if (Nationalite_ == true || Mm_ == true)
    		i = ::Console_Lire_txt(Textes, textes, 0, j, Y, C_T, C_t);
    	// Image
    	if (Image_ == true)
    	{
    		Textes = L"Image";
    		textes = L"¬¬¬¬¬";
    		j = 9;
    		if (Image.size() > 1)
    		{
    			Textes += L's';
    			textes += L'¬';
    			j = 10;
    		}
    		Textes += L" : [";
    		textes += L" ¬ ¬";
    		for (iter = Image.begin(), i = 0; iter != Image.end(); iter++, i++)
    		{
    			Textes += *iter;
    			textes += *iter;
    			if (i < Image.size() - 1)
    			{
    				Textes += L", ";
    				textes += L"¬ ";
    			}
    		}
    		Textes += L']';
    		textes += L'¬';
    		i = ::Console_Lire_txt(Textes, textes, 0, j, Y, C_T, C_t);
    	}
    	// Netflix ?
    	if (Sur_ == false)
    	{
    		i = 0;
    		wstr = L"";
    		while (i < D_I)
    		{
    			if (Date_1_t[i].substr(0, 6) == L"Netflix")
    			{
    				Netflix_ = true;
    				break;
    			}
    			if(Date_1_t[i] != L"")
    			{
    				wstr = Date_1_t[i];
    			}
    			i++;
    		}
    		if(wstr == L"" || Netflix_ == true)
    		    i = ::Console_Lire_txt(
    			    L"Netflix : Oui !",
    			    L"¬¬¬¬¬¬¬ ¬ Oui ¬",
    			    0, j, Y, C_T, C_t);
    	}
    	//
    	::Console_Lire_txt(L"---------- ", Y);
    	if (titre_ == true)
    	{ // Titre = 4
    		iter = Titre.begin();
    		iter += 3;
    		i = ::Console_Lire_txt(*iter, L"", 4, 0, Y, 0, 0);
    		::Console_Lire_txt(L"---------- ", Y);
    	}
    	// Date_1
    	I = 0;
    	if (D_I == 0)
    	{
    		wcout << L"Date_1 érreur  aaaaaaaaaaaa" << endl;
    	}
    	else
    	{
    		if (D_I == 1)
    		{
    			Textes = textes = L"";
    			wcsftime(date_string, 15, L"%d/%m/%Y", &Date_1[0][0]);
    			wstr = date_string;
    			Textes += L' ' + wstr.substr(0, 2) + L'/' + wstr.substr(3, 2) + L'/' + wstr.substr(6, 4);
    			textes += L' ' + wstr.substr(0, 2) + L'¬' + wstr.substr(3, 2) + L'¬' + wstr.substr(6, 4);
    			if (D_1_[0] == L'_')
    			{
    				Textes += L"(_)";
    				textes += L"¬_¬";
    			}
    			if (Date_1_t[0] != L"")
    			{
    				Textes += L" : " + Date_1_t[0];
    				textes += L" ¬ " + Date_1_t[0];
    			}
    			i = ::Console_Lire_txt(Textes, textes, 4, 4, Y, C_T, C_t);
    		}
    		else
    		{
    			basic_string <wchar_t>::size_type pos = 0;
    			int j;
    			while (I < D_I)
    			{
    				Textes = textes = L"";
    				if (D_J[I] == 0)
    				{
    					wcsftime(date_string, 15, L"%d/%m/%Y", &Date_1[I][0]);
    					wstr = date_string;
    					Textes += L' ' + wstr.substr(0, 2) + L'/' + wstr.substr(3, 2) + L'/' + wstr.substr(6, 4);
    					textes += L' ' + wstr.substr(0, 2) + L'¬' + wstr.substr(3, 2) + L'¬' + wstr.substr(6, 4);
    					if (D_1_[I] == L'_')
    					{
    						Textes += L"(_)";
    						textes += L"¬_¬";
    					}
    					if (Date_1_t[I] != L"")
    					{
    						Textes += L" : " + Date_1_t[I];
    						textes += L" ¬ " + Date_1_t[I];
    					}
    					j = ::Console_Lire_txt(Textes, textes, 4, 4, Y, C_T, C_t);
    				}
    				else if(D_J[I] > 0)
    				{
    					int j;
    					wstring M[10], m[10];
    					for (j = 0; j < D_J[I] + 1; j++)
    					{
    						wcsftime(date_string, 15, L"%d/%m/%Y", &Date_1[I][j]);
    						wstr = date_string;
    						M[j] = wstr.substr(0, 2) + L'/' + wstr.substr(3, 2) + L'/' + wstr.substr(6, 4);
    						m[j] = wstr.substr(0, 2) + L'¬' + wstr.substr(3, 2) + L'¬' + wstr.substr(6, 4);
    					}
    					wstring n = M[0];
    					int o = 0, p = 0;
    					for (j = 1; j < D_J[I] + 1; j++)
    					{
    						if (n == M[j])
    						{
    							M[j] = L'(';
    							m[j] = L'¬';
    							M[j] += to_wstring(o + 1);
    							m[j] += to_wstring(o + 1);
    							M[j] += L')';
    							m[j] += L'¬';
    							if (M[j - 1] == n && o == 0)
    							{
    								M[j - 1] += L" (1)";
    								m[j - 1] += L" ¬1¬";
    							}
    							o++;
    						}
    						else
    						{
    							n = M[j];
    							o = 0;
    						}
    					}
    					j = 1;
    					p = 0;
    					o = D_J[I] + 1;
    					while (j < o)
    					{
    						if (M[j][2] == L')')
    						{
    							M[p] += M[j];
    							m[p] += m[j];
    							M[j].clear();
    							m[j].clear();
    						}
    						else
    							p++;
    						j++;
    					}
    					j = 0;
    					p = 0;
    					wstring q[10] = { L"" }, Q[10] = { L"" };
    					while(j < o)
    					{
    						if (M[j] != L"")
    						{
    							Q[p] = M[j];
    							q[p] = m[j];
    							p++;
    						}
    						j++;
    					}
    					o = p;
    					p = 0;
    					while (p < o)
    					{
    						pos = Q[p].find_last_of(L")(");
    						if (pos != wstring::npos)
    						{
    							Q[p] = Q[p].substr(0, pos - 2) + L" et " + Q[p].substr(pos - 2);
    							q[p] = q[p].substr(0, pos - 2) + L" ¬¬ " + q[p].substr(pos - 2);
    							Textes += Q[p];
    							textes += q[p];
    						}
    						else
    						{
    							Textes += Q[p];
    							textes += q[p];
    						}
    						if (p < o - 2)
    						{
    							Textes += L", ";
    							textes += L"¬ ";
    						}
    						else if (p < o - 1)
    						{
    							if (pos != wstring::npos)
    							{
    								Textes += L", ";
    								textes += L"¬ ";
    								pos = 0;
    							}
    							else
    							{
    								Textes += L" et ";
    								textes += L" ¬¬ ";
    							}
    						}
    						p++;
    					}
    					if (D_1_[I] == L'_')
    					{
    						Textes += L"(_)";
    						textes += L"¬_¬";
    					}						
    					if (Date_1_t[I] != L"")
    					{
    						Textes += L" : " + Date_1_t[I];
    						textes += L" ¬ " + Date_1_t[I];
    					}
     
    					j = ::Console_Lire_txt(Textes, textes, 4, 8, Y, C_T, C_t);
    				}
    				else
    				{
    					wcout << L"afficher_OK() D_J érreur !!!" << endl;
    					return -1;
    				}
     
    				I++;
    			}
    		}
    		::Console_Lire_txt(L"---------- ", Y);
    	}
    	// Avec et Avec_role
    	if (Avec_ == true && Avec_role.size() != 0)
    	{
    		i = ::Console_Lire_txt(L"Avec :", L"¬¬¬¬¬¬", 0, 0, Y, C_T, C_t);
    		Textes = textes = L"";
    		for (iter = Avec_role.begin(), i = 0; iter != Avec_role.end(); iter++, i++)
    		{
    			wstr = *iter;
    			pos = wstr.find(L" : ");
    			if (pos == wstring::npos)
    			{
    				Textes = Textes + *iter;
    				textes = textes + *iter;
    			}
    			else
    			{
    				Textes = Textes + wstr.substr(0, pos) + L" (" + wstr.substr(pos + 3) + L')';
    				textes = textes + wstr.substr(0, pos) + L"¬¬" + wstr.substr(pos + 3) + L'¬';
    			}
    			if (i != Avec_role.size() - 1)
    			{
    				Textes = Textes + L", ";
    				textes = textes + L"¬¬";
    			}
    		}
    		i = ::Console_Lire_txt(Textes, textes, 4, 0, Y, C_T, C_t);
    		::Console_Lire_txt(L"---------- ", Y);
    	}
    	// X_I
    	//if (X_I != 0)
    	//{
    		i = 0;
    		while (i < X_I)
    		{
    			wcout.width(2);
    			wcout << X_i[i];
    			wcout << /*X_i[i] << L" : " << X_T[i] << */L" : " << X[i] << endl;
    			//wcout << X_i[i] << L" : " << X_T[i] << L" : " << X[i] << endl;
    			i++;
    		}
    		if(X_I != 0)
    			::Console_Lire_txt(L"---------- ", Y);
    		//}
    	return 0;
    }
    Ok ou pas ?

  2. #62
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Exemple :
    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
    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
    const int Console_Lire_txt(wstring Textes, wstring textes, int y1, int y2, int Y, int in = 15, int out = 0)
    {
        if (Textes == L"" && Y == 0)
            return 0;
        if (textes == L"")
            textes = Textes;
        rtrim(Textes);
        rtrim(textes);
        //
        bool ligne_vide = false;
        bool retrait = false;
        wchar_t entree = L'\n';
     
        int I, y;
        int i, j, k, n = 0;
        int l, m;
        basic_string <wchar_t>::size_type N;
     
        bool P = false;
        bool p = false;
     
        //
        Textes = Textes + entree;
        N = Textes.length();
     
        y = y1;
        I = Y - y;
        j = 0;
        if (I < N)
            n = I;
        else
            n = (int)N;
     
        while (j < N)
        {
            // Ok
            if (Textes[j] == entree && retrait == true)
            {
                ligne_vide = true;
                retrait = true;
                goto _ok_;
            }
            // Ok
            for (i = 0; i < y; i++)
    #if afficher_Console_Lire_txt_ == 1
                wcout << L'_';
    #else
                wcout << L' ';
    #endif
            while (Textes[j] == L' ')
            {
                j++;
                n++;
                if (n > N)
                    n = (int)N;
            }
            // Ok
            k = j;
            for (j = k; k < n; k++)
            {
                if (Textes[k] == entree)
                {
                    break;
                }
            }
            if (k != n)
            {
                retrait = true;
                n = k;
            }
            else
            { // ???
                ligne_vide = false;
                retrait = false;
                while (Textes[n] != L' ')
                {
                        n--;
                }
            }
            // Ok
            k = j;
            l = 0;
            for (j = k; k < n; k++)
            {
                if(Textes[k] == textes[k])
                    wcout << Textes[k];
                else
                {
                    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), in);
                    wcout << Textes[k];
                    SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), out);
                }
                l++;
            }
            // Ok
            j = k;
            m = Y - (y + l);
            for (i = 0; i < m; i++)
            {
    #if afficher_Console_Lire_txt_ == 1
                wcout << L'*';
    #else
                wcout << L' ';
    #endif
            }
            // Ok
        _ok_:
            if (ligne_vide == true && retrait == true)
            {
                ligne_vide = false;
                //retrait = true;
                j++;
                n++;
                if (n > N)
                    n = (int)N;
                y = y1;
                continue;
            }
            else if (ligne_vide == false && retrait == true)
            {
                retrait = false;
                y = y1;
            }
            else
            {
                ligne_vide = false;
                retrait = false;
                y = y2;
            }
            j = n; 
            j++;
            // y ?
            n = n + (Y - y);
            if (n > N)
                n = (int)N;
        }
        return 0;
    }
    Oui ou non ?

    Merci beaucoup

  3. #63
    Expert éminent sénior
    Avatar de koala01
    Homme Profil pro
    aucun
    Inscrit en
    Octobre 2004
    Messages
    11 627
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : aucun

    Informations forums :
    Inscription : Octobre 2004
    Messages : 11 627
    Points : 30 692
    Points
    30 692
    Par défaut
    Salut,

    Excuses moi, Laurent, mais tu n'arrives bien souvent pas à structurer tes questions de manière cohérente et compréhensible pour nous, qui sommes peut-être à des milliers de kilomètres de toi, et qui ne savons ni ce que tu fais ni quels sont tes objectifs.

    Dans ta question d'origine, tu nous présente deux superbes captures d'écran sans nous poser la moindre question et dont la seule chose que l'on puisse dire c'est que "ben a priori, ca fonctionne. Quel est le problème?"

    Dans tes deuxièmes et troisièmes question, tu nous "balance" un code de 140 lignes (ou presque) et de près de 600 lignes et tes seules questions "Oui ou non?" "Ok ou pas?". Et on ne sait toujours pas ce que tu attends de notre part.

    On se doute bien que tu espères que l'on "valide" ton code d'une manière ou d'une autre, mais on ne sait pas si tu t'attends à ce qu'on t'aide à le corriger pour qu'il compile (ce sera déjà pas mal ) ou pour le faire fonctionner (ce qui serait encore mieux), voire, même pour simplement l'améliorer d'une manière ou d'une autre.

    On peut donc te faire quelques remarques d'ordre générales sur le code, comme:
    une fonction qui fait plus de 50 lignes (certains n'hésiteront pas à descendre à 25), c'est vraiment trop long
    ou comme
    devoir fournir sept paramètres à une fonction, ca devient clairement casse-gueule: l'idéal est de ne pas dépasser trois ou quatre (as tu pensé à créer des structures pour représenter ces données?)
    ou même comme
    Tu devrais apporter le au choix des noms des paramètres de tes fonctions qu'au choix du nom des fonctions elles-mêmes, car ce sont les noms de tes variables (ou de tes paramètres) et de tes fonctions qui nous permettront le mieux de comprendre ce que tu cherches à faire.

    Ainsi, sur la ligne de code const int Console_Lire_txt(wstring Textes, wstring textes, int y1, int y2, int Y, int in = 15, int out = 0), on pourrait faire des remarques plus précises comme
    • avoir un paramètre qui s'appelle Textes (avec une majuscule) et un autre qui s'appelle textes(sans majuscule), qui sont du même type, c'est particulièrement casse-gueule.
    • avoir des paramètres nommés y1, y2 et Y (tiens, pourquoi le dernier est-il en majuscule, alors que les autres sont en minuscules ) ne nous dit absolument rien quant à l'usage que tu prévois de faire de ces paramètres
    • Tu devrais vraiment faire attention à choisir des noms pour tes variables et tes paramètres qui permettent d'indiquer clairement l'usage que tu compte en faire
    Nous pourrions même aller plus loin et te faire remarquer que le simple fait que tu aies eu besoin d'utiliser un goto (et des break dans différentes boucles) montre que, si la logique fonctionne (peut-être), il serait sans doute possible, en plaçant les différents objectifs de cette fonction dans des fonctions séparées, d'arriver à la rendre "plus homogène" et plus "cohérente".

    Au delà de cela, et des commentaires que certains pourraient faire s'il trouve le courage (dont je manque aujourd'hui) d'analyser le code plus en profondeur, à part te dire que "ben, si ca compile et que cela fonctionne, c'est que c'est bon", nous ne pourrons sans doute pas dire grand chose

  4. #64
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Excuses moi, Laurent, mais...
    sans doute pas dire grand chose
    Rapide et fonctionne !!!

    Merci beaucoup Philippe

  5. #65
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Bonjour,

    Lire : oui !
    Mais écrire : ben non !!!

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    cout << "Titre : " << endl;
    cin >> titre >> endl;
    cout << "Chaîne : " << endl;
    cin >> chaine >> endl;;
    Compliqué ?

    Virginie : est-il possible de simplifier le code pour écrire ?

    Merci beaucoup

  6. #66
    Invité
    Invité(e)
    Par défaut
    Encore et toujours, ça manque cruellement de détails pour pouvoir te répondre efficacement.

    Mais probablement Comment saisir une chaîne contenant des espaces ?

  7. #67
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0

  8. #68
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Bonjour,

    Lire : Oui !


    Ecrire : ??? cin et Console ?

    Titre : __________________________
    Distributeur :
    Genre :
    De :
    Par :
    Avec :
    Nationalité :
    Image :
    Netflix :
    Merci beaucoup ;-)

  9. #69
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Moi : L'aphasie !!!

  10. #70
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Bonjour,

    Lire :
    d:
    cd /work/prg/cpp/you/x64/Release
    you /t s "e:\Séries.[]\Azertyuiop.[2021- Netflix].Manga"
    you /t s "e:\Séries.[]\++++\M\Mr. Robot.[2015-2019]"
    rem You /t s "e:/Séries.[]/++++/T/The Walking Dead.[2010-2021]"
    you /t s "e:/Séries.[]/+++/T/The ( )/The Heroic Leged of Arslân.[2015].Manga"
    you /t s "e:\Séries.[]\++++\G\Giri - Haji.[2019]"
    you /t s "e:/Séries.[]/Rick et Morty.[2014-].Animation"
    you /t s "e:\Séries.[]\++\V\Valeria.[2020- Netflix]"
    you /t s "e:\Séries.[]\++++\L\La casa de papel.[2017- Netflix]"
    you /t s "e:\Séries.[]\Blacklist.[2013-]"
    you /t s "e:\Séries.[]\++++\S\Sermons de minuit.[2021 Netflix]"
    you /t s "e:\Séries.[]\+++\Q\Qui a tué Sara $.[2021- Netflix]"
    you /t s "e:\Séries.[]\++++\B\Black Mirror.[2011-2018 Netflix]"
    you /t s "e:\Séries.[]\+++\B\B - The Beginning.[2018 Netflix].Manga"
    you /t s "e:\Séries.[]\+++\Y\You.[2018- Netflix]"
    you /t s "e:\Séries.[]\++++\L\Locke & Key.[2020- Netflix]"
    you /t s "e:\Séries.[]\++++\A\Arcane.[2021- Netflix].Animation"
    you /t s "e:\Séries.[]\+++\M\Maid.[2021 Netflix].Mini-série"
    you /t s "e:\Séries.[]\++++\T\The Spy.[2019 Netflix].Mini-série"
    you /t s "e:\Séries.[]\++++\H\Hellbound.[2021- Netflix]"
    you /t s "e:\Séries.[]\+++\L\Le parfum.[2018 Netflix]"
    you /t s "e:\Séries.[]\+++\T\The ( )\The Club.[2019 Netflix]"
    you /t s "e:\Séries.[]\+++\L\La Réalité en face.[2021 Netflix]"
    you /t s "e:\Séries.[]\++++\C\Cowboy Bebop.[2021 Netflix]"
    you /t s "e:\Séries.[]\+++\S\Scène de crime - La disparue de Cecil Hotel.[2021 Netflix].Documentaire"
    you /t s "e:\Séries.[]\++++\L\La disparition de Maddie McCann.[2019 Netflix].Documentaire"
    you /t s "e:\Séries.[]\+++\P\Perdus dans l'espace.[2018- Netflix]"
    you /t s "e:\Séries.[]\+++\C\Coyotes.[2021]"
    you /t s "e:\Séries.[]\+++\T\Titans.[2018- ]"
    you /t s "e:\Séries.[]\+++\D\Don't F++k With Cats - Un tueur trop viral.[2019 Netflix].Mini-série"
    you /t s "e:\Séries.[]\+++\J\Jojo's Bizarre Adventure.[2012-2019 Netflix].Manga"
    you /t s "e:\Séries.[]\++++\T\The Witcher.[2019- Netflix]"
    you /t s "e:\Séries.[]\++++\T\The Silent Sea.[2021 Netflix]"
    you /t s "e:\Séries.[]\++++\A\All of Us Are Dead.[2022- Netflix]"
    you /t s "e:\Séries.[]\+++\L\Le Traqueur de la nuit - Chasse à l'homme en Californie.[2021 Netflix].Documentaire"
    Écrire ???

    Je sais lire mais je n'arrive pas à écrire, comment faire ?
    Merci beaucoup

  11. #71
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Bonsoir,

    Ok : https://docs.microsoft.com/fr-fr/win...e-applications, etc...

    Pour les options qui spécifient des couleurs, celles-ci sont utilisées comme défini dans la table de couleurs de la console, qui peut être modifiée à l’aide de l’API SetConsoleScreenBufferInfoEx. Si la table est modifiée afin que la position « bleu » dans la table affiche une nuance RVB rouge, tous les appels à Premier plan en bleu affichent cette couleur rouge jusqu’à ce qu’une nouvelle modification soit effectuée.
    ECHAP [ < n > m
    Comment faire ?

    Merci beaucoup

  12. #72
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Bonsoir,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    wcout << L"\x1b[32;1mBonjour\x1b[0m" << endl;
    ←[32;1mBonjour←[0m
    ???

  13. #73
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 379
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 379
    Points : 41 573
    Points
    41 573
    Par défaut
    Il me semble qu'il y a eu des améliorations de la console pour apporter le support des séquences d'échappement, mais je n'ai plus les détails.
    Cette série d'articles en anglais peut aider:
    https://devblogs.microsoft.com/comma...onsole-conpty/

  14. #74
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Bonjour,

    Médinoc et koala01 : merci pour tout !!!

    J'ai oublié suite à un AVC pour savoir comment faire à traduire les codes. Merci (la personne qui m'aide à écrire n'arrive pas bien à retranscrire ce que je veux vous expliquer).

    Nom : Capture.PNG
Affichages : 286
Taille : 11,7 Ko

    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
    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
    const int Console_Lire_txt(wstring Textes, int y1, int y2, int Y)
    {
        if (Textes == L"" && Y == 0)
            return 0;
        rtrim(Textes);
        //
        bool ligne_vide = false;
        bool retrait = false;
        wchar_t entree = L'\n';
     
        int I, y;
        int i, j, k, n = 0;
        int l, m;
        basic_string <int>::size_type N;
        // // // //  //
        //Textes = Textes + entree;
        // // // //  //
        N = Textes.length();
        int p = 0;
        vector<wstring> P;
        wstring o;
        i = 0;
        while (i < N)
        {
            if (Textes[i] == L'\x1b')
            {
                o = L'\x1b';
                i++;
                while (Textes[i] != L'm' || i == N)
                {
                    o += Textes[i];
                    i++;
                }
                if (i == N)
                {
                    ::afficher_X(-1, L"Console_Lire_txt()", L"i == N");
                    return -1;
                }
                o += L'm';
                P.push_back(o);
                p++;
                //wcout << L"p=" << (p) << L" o=[" << o.substr(1) << L']' << endl;
            }
            i++;
        }
        //
        y = y1;
        I = Y - y;
        j = 0;
        if (I < N)
            n = I;
        else
            n = (int)N;
        vector <wstring>::iterator iter;
        iter = P.begin();
        while (j < N)
        {
            // Ok
            if (Textes[j] == entree && retrait == true)
            {
                ligne_vide = true;
                retrait = true;
                goto _ok_;
            }
            // Ok
            for (i = 0; i < y; i++)
    #if Console_Lire_txt_ == 1
                wcout << L'_';
    #else
                wcout << L' ';
    #endif
            while (Textes[j] == L' ')
            {
                j++;
                n++;
                if (n > N)
                    n = (int)N;
            }
            // Ok
            k = j;
            for (j = k; k < n; k++)
            {
                if (Textes[k] == entree)
                {
                    break;
                }
            }
            if (k != n)
            {
                retrait = true;
                n = k;
            }
            else
            { // ???
                ligne_vide = false;
                retrait = false;
                while (Textes[n] != L' ')
                {
                    n--;
                }
            }
            // Ok
            k = j;
            l = 0;
            while(k < n)
            {
                if (Textes[k] != L'\x1b')
                {
                    wcout << Textes[k];
                    l++;
                    k++;
                }
                else
                {
                    o = *iter;
                    wcout << o;
                    iter++;
                    //l += (int)o.length();
                    //l++;
                    k += (int)o.length();
                    n += (int)o.length();
                    if (n > N)
                        n = (int)N;
                }
            }
            // Ok
            j = k;
            m = Y - (y + l);
            for (i = 0; i < m; i++)
            {
    #if Console_Lire_txt_ == 1
                wcout << L'*';
    #else
                wcout << L' ';
    #endif
            }
            // Ok
        _ok_:
            if (n >= N)
            {
                break;
            }
            else if (ligne_vide == true && retrait == true)
            {
                ligne_vide = false;
                j++;
                n++;
                if (n > N)
                    n = (int)N;
                y = y1;
                continue;
            }
            else if (ligne_vide == false && retrait == true)
            {
                retrait = false;
                y = y1;
            }
            else
            {
                ligne_vide = false;
                retrait = false;
                y = y2;
            }
            j = n;
            j++;
            // y ?
            n += (Y - y);
            if (n > N)
                n = (int)N;
        }
        return 0;
    }
    Que faire ???

  15. #75
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Bonsoir à tous !

    Ok : Séquences de terminal virtuel de console (https://docs.microsoft.com/fr-fr/win...inal-sequences)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    struct PERSON
    {
    /*...*/
        wstring S_T = L"\x1b[94;1m";
        wstring S_t = L"\x1b[37;40m";
     
    }_P_;
    et :
    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
    const int Series::afficher_OK()
    { // OK !
    /* etc... */
    	// Avec et Avec_role
    	if (Avec_ == true && Avec_role.size() != 0)
    	{
    		i = ::Console_Lire_txt(_P_.S_T + L"Avec :" + _P_.S_t, 0, 0, Y);
    		Textes = textes = L"";
    		for (iter = Avec_role.begin(), i = 0; iter != Avec_role.end(); iter++, i++)
    		{
    			wstr = *iter;
    			pos = wstr.find(L" : ");
    			if (pos == wstring::npos)
    				Textes += *iter;
    			else
    				Textes += wstr.substr(0, pos) + _P_.S_T + L" (" + _P_.S_t + wstr.substr(pos + 3) + _P_.S_T + L')' + _P_.S_t;
    			if (i != Avec_role.size() - 1)
    				Textes += _P_.S_T + L", " + _P_.S_t;
    		}
    		i = ::Console_Lire_txt(Textes, 4, 0, Y); // Ah ! Mince !!!
    		::Console_Lire_txt(L"---------- ", Y);
    	}
    /* etc... */
    	E.Ok();
    
    	//}
    	return 0;
    }
    Mais :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    const int Console_Lire_txt(wstring Textes, int y1, int y2, int Y)
    Alors... L'A.V.C., j'ai oublié...

    Que faire ???

    Merci beaucoup...

  16. #76
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0

  17. #77
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut const int You_Rechercher(int c, wchar_t** v)
    Bonsoir,

    Je rechercher :
    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
    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
    const int You_Rechercher(int c, wchar_t** v)
    {
        size_t pos = 0;
        //static const basic_string <wchar_t>::size_type npos = -1;
        size_t npos = -1;
        wstring t;
    #if You_Rechercher_ == 1
        wcout << L"You_Rechercher() :" << endl;
    #endif
        wcout << P.R_T << L"Rechercher :" << P.R_t << endl;
        if (v[3][0] == L'\0')
        {
            wcerr << L"Érreur !!! (v[3][0] == L'\0')" << endl;
            E.afficher_X(-3, L"v[3][0] == L'\0' érreur !!!", L"Érreur !!!");
            return -3;
        }
        wstring rechercher = v[3];
        wstring RECHERCHER = rechercher;
        transform(RECHERCHER.begin(), RECHERCHER.end(), RECHERCHER.begin(), ::toupper);
        wstring r_r = RECHERCHER.substr(0, 1);
        //
        if (v[2][0] == L's' && v[2][1] == L'\0')
        {
            P_cs = P_serie;
            P.P_T = P.S_W;
            P.P_t = P.S_w;
        }
        else if (v[2][0] == L'c' && v[2][1] == L'\0')
        {
            P_cs = P_cinema;
        }
        else if (v[2][0] == L'c' && v[2][1] == L'v' && v[2][2] == L'\0')
            P_cs = P_cinema_VOD;
        else if (v[2][0] == L'c' && v[2][1] == L'd' && v[2][2] == L'\0')
            P_cs = P_cinema_DVD;
        else
        {
            wcerr << L"Érreur !!!" << endl;
            E.afficher_X(-3, L"Érreur !!!", L"Érreur !!!");
            return -3;
        }
        if (v[2][0] == L'c')
        {
            P.P_T = P.C_T;
            P.P_t = P.C_t;
        }
        //
        int i = 0;
        vector<wstring>r;
        r.push_back(P_cs.cs + L"\\" + r_r);
        r.push_back(P_cs.cs + L"\\-" + r_r);
        r.push_back(P_cs.cs + L"\\+\\" + r_r);
        r.push_back(P_cs.cs + L"\\++\\" + r_r);
        r.push_back(P_cs.cs + L"\\+++\\" + r_r);
        r.push_back(P_cs.cs + L"\\++++\\" + r_r);
        r.push_back(P_cs.cs + L"\\+++++\\" + r_r);
        vector<wstring>::iterator iter;
        wstring TT;
        wstring rr;
        for (iter = r.begin(); iter != r.end(); iter++)
        {
            rr = *iter;
            for (directory_iterator next(*iter), end; next != end; ++next)
            {
                t = next->path();
                if (is_directory(t))
                {
                    TT = t;
                    transform(TT.begin(), TT.end(), TT.begin(), ::toupper);
                    pos = TT.find(RECHERCHER);
                    if (pos != wstring::npos)
                    {
                        if (*iter != L"" && rr == *iter)
                        {
                            wcout << L">> " << P.P_T << *iter << P.P_t << endl;
                            rr = L"";
                        }
                        wcout << L"    " << t << endl;
                        i++;
                    }
                }
            }
        }
        if (i == 0)
            wcout << L"    " << L"Pas de rechercher !!!" << endl;
    #if You_Rechercher_ == 1
        wcout << L"You_Rechercher() : Ok !" << endl;
    #endif
        return EXIT_SUCCESS;
    }
    D:\Work\Prg\CPP\You\x64\Release>you /R s "U"
    You_Rechercher() :
    Rechercher :
    >> e:\Séries.[]\\+++\U
    e:\Séries.[]\\+++\U\Ultraman.[2019- Netflix].Manga
    e:\Séries.[]\\+++\U\Ultramarine Magmell.[2019- Netflix].Manga
    e:\Séries.[]\\+++\U\Un bail en enfer.[2022- Netflix].Mini-série
    e:\Séries.[]\\+++\U\Unbelievable.[2019 Netflix]
    e:\Séries.[]\\+++\U\Undercover.[2019- Neztflix]
    e:\Séries.[]\\+++\U\Under_The_Dome.[2013]
    e:\Séries.[]\\+++\U\Une nuit en enfer - La série.[2014-2016]
    e:\Séries.[]\\+++\U\Une vérité enfouie - La disparition de Birgit Mieier.[2021 Netflix].Mini-série
    e:\Séries.[]\\+++\U\Unorthodox.[2020- Netflix]
    e:\Séries.[]\\+++\U\Unsolved Mysteries.[2020- Netflix].Documentaire
    You_Rechercher() : Ok !
    Mais :
    E:\Séries.[]\+++++>dir
    Le volume dans le lecteur E s’appelle data 2
    Le numéro de série du volume est B0E2-8ED2

    Répertoire de E:\Séries.[]\+++++

    2022-06-24 01:20 <DIR> .
    2022-06-24 01:20 <DIR> ..
    2022-07-10 23:52 <DIR> Umbrella Academy.[2019- Netflix]
    0 fichier(s) 0 octets
    3 Rép(s) 695*317*086*208 octets libres
    Que faire ?

    Merci à tous !!!

  18. #78
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 152
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 152
    Points : 12 260
    Points
    12 260
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    for (directory_iterator next(*iter), end; next != end; ++next)
    "end" est censé être initialisé à quoi ?

    Utilisez un débogueur pour suivre pas à pas l'exécution de votre programme.

  19. #79
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Avant, je programmais ! En 2008, j'ai fais un AVC (Accident Vasculaire Cérébral) de 5 jour ! Maintenant, j'ai oublié !

    Visual Studio -> Déboguer -> Démarrer le débogage ?

    Merci ;-)

  20. #80
    Nouveau Candidat au Club Avatar de Laurent_B_
    Homme Profil pro
    Ingénieur de déploiement réseaux
    Inscrit en
    Avril 2021
    Messages
    544
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur de déploiement réseaux
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Avril 2021
    Messages : 544
    Points : 0
    Points
    0
    Par défaut
    Mais :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    for (directory_iterator next(path("abc")), end; next != end; ++next)
        visit(next->path());
    Ici : https://docs.microsoft.com/fr-fr/cpp...?view=msvc-170
    Ici : https://docs.microsoft.com/fr-fr/cpp...?view=msvc-170

    Quel faire ???

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Probléme avc la formclosing
    Par dv-2008 dans le forum VB.NET
    Réponses: 2
    Dernier message: 23/03/2008, 16h33
  2. probléme avc console.readline()
    Par dv-2008 dans le forum VB.NET
    Réponses: 7
    Dernier message: 10/03/2008, 00h33
  3. j'ai un probléme avc un code vb.net aider moi svp
    Par dv-2008 dans le forum VB.NET
    Réponses: 12
    Dernier message: 29/01/2008, 09h20
  4. Problème avc une requête
    Par Raiga dans le forum Requêtes et SQL.
    Réponses: 3
    Dernier message: 30/06/2007, 18h36
  5. Toujours problème de lien avce la lib Cblas
    Par Kirou dans le forum Autres éditeurs
    Réponses: 1
    Dernier message: 19/06/2007, 14h50

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo