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++/CLI Discussion :

Code De Système d'enregistrement de répertoire Téléphonique


Sujet :

C++/CLI

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2017
    Messages
    67
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2017
    Messages : 67
    Points : 29
    Points
    29
    Par défaut Code De Système d'enregistrement de répertoire Téléphonique
    Bonjours / bonsoir à tous selon votre lieu de résidence.

    Je vous écris pour solliciter votre aide, en effet j'ai écris un code pour Gérer un système d'enregistrement de répertoire Téléphonique en c++ procédurale.
    Cependant j'ai un petit soucis avec mes deux fonctions que je vous soumets ici et son message d'erreur. Je ne vous ais pas mis le code en entier car les
    autres fonctions fonctionne mais si vous voulez tout le code faite le moi savoir et je le soumettrez ici ! Je vous remercie d'avance pour vos réponses passé
    une excellente journée / soirée.

    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
     
     
    //Fonction main.
     
    int main()
    {
        //Variables.
        int ChoixOptions(0);
        int Nbc(0);
        char rep(' ');
        std::string nom[1000];
        std::string pren[1000];
        int Tel[1000];
     
        //Message de bienvenu(e).
        std::cout<<"\t\t\t\t\t\t Bienvenu(e) dans notre gestionnaire Téléphonique."<<std::endl;
        std::cout<<std::endl;
     
      //Menu d'accueuille.
      do
      {
        std::cout<<"\t\t\t\t\t\t -------- Menu des options --------"<<std::endl;
        std::cout<<std::endl;
        std::cout<<"\t\t\t\t\t\t 1. Ajoute de contactes"<<std::endl;
        std::cout<<"\t\t\t\t\t\t 2. Recherche d\'un contacte"<<std::endl;
        std::cout<<"\t\t\t\t\t\t 3. Modification du contact"<<std::endl;
        std::cout<<"\t\t\t\t\t\t 4. Suppresion d\'un contacte"<<std::endl;
        std::cout<<std::endl; std::cout<<std::endl;
     
        std::cout<<"Veuillez faire un choix dans le menu d\'accueille : ";
        while(!(std::cin >> ChoixOptions))
        {
    	std::cout<<"Entrer un chiffre de 1 à 4 Svp!"<<std::endl;
    	std::cin.clear();
    	std::cin.ignore(255,'\n');
        }
     
    	//Choix dans le menu d'accueuille.
    	if (ChoixOptions == 1)
        	{
    		AjoutContact(Nbc,nom,pren,Tel);
        	}
        	else if (ChoixOptions == 2)
        	{
    		Recherche(Nbc,nom,pren,Tel);
        	}
     	else if (ChoixOptions == 3)
    	{
    		Modification(Nbc, nom, pren, Tel);
    	}
    	else if (ChoixOptions == 4)
    	{
    		Suppression(Nbc, nom, pren, Tel);
    	}
     
    	std::cout<<"Voulez vous refaire un choix ? : ";
    	std::cin >> rep;
     
        }while(rep == 'O' || rep =='o'); 	
    }
     
     
     
    //Fonction recherche Nom Tel Prénom
    void Recherche(int& Nbc , std::string nom[], std::string pren[], int Tel[])
    {
    	//Variables.
    	std::string nomRech(""); //Variable pour la recherche de nom.
    	std::string prenRech("");//Variable pour la recherche de prénom.
    	int modifRech(0); //Variable pour la modification du numéro de téléphone.
    	int choixRech(0); //Variable pour le choix dans le menu de recherche.
     
     
    	//Menu de recherche
     	std::cout<<std::endl;	
    	std::cout<<"\t\t\t\t\t\t --------- Menu de recherche ---------"<<std::endl; 
    	std::cout<<"\t\t\t\t\t\t 1. Par nom."<<std::endl;
    	std::cout<<"\t\t\t\t\t\t 2. Par prénom."<<std::endl;
    	std::cout<<"\t\t\t\t\t\t 3. Par numéro de téléphoner."<<std::endl;
     
    	std::cout <<"Quelle est votre choix dans le menu recherche  ? : ";
     
        	while(!(std::cin >> choixRech))
        	{
    		std::cout<<"Entrer un chiffre de 1 à 3 Svp!"<<std::endl;
    		std::cin.clear();
    		std::cin.ignore(255,'\n');
        	}
     
    	//Condition sur les choix des options du menu de recherche (nom, prénom, Téléphone)
    	for(int i(0); i < Nbc; i++)	
    	{ 
    		if(choixRech == 1)
    		{
     
    			ValidationDonnee(Nbc,nom[i],pren[i],choixRech,modifRech,Tel,  nomRech, prenRech); 
    		}
    		if(choixRech == 2)
    		{
     
    			ValidationDonnee(Nbc,nom[i], pren[i], choixRech,modifRech,Tel, nomRech, prenRech); 
    		}	
     
    		if (choixRech == 3)
    		{
    			ValidationDonnee(Nbc,nom[i], pren[i], choixRech,modifRech,Tel, nomRech, prenRech); 
    		}	
    	}
     
    }
     
    //Fonction de validation des données entrée.
    void ValidationDonnee(int& Nbc,std::string nom, std::string pren[], int choixRech, int modifRech,int Tel[], std::string nomRech, std::string prenRech)
     
    {	
    	bool ValideNom = false; //Variable de validation du nom
    	bool ValidePren = false;
    	bool ValideTel = false; //Varible de validation du numéro de téléphone
     
     	if(choixRech == 1)
    	{
     
    		std::cout<<"Veuillez introduire votre nom."<<std::endl;
    		std::cin >> nomRech;
     
    		for(int i(0); i < Nbc; i++)
    		{
    			if(nomRech == nom[i])
    			{
    				ValideNom = true;
    				break;
    			}
    		}
    	}
    	else if (choixRech == 2)
    	{
    		std::cout<<"Veuillez introduire votre prénom."<<std::endl;
    		std::cout <<"Prénom : "<<std::endl;
    		std::cin >> prenRech;
     
    		for(int i(0); i < Nbc; i++)
    		{
    			if(prenRech == pren[i]);
    			{
    				break;
    			}
    		}
    	}
    	else if (choixRech == 3)
    	{
     
    		std::cout<<"Veuillez introduire votre numéro de téléphone."<<std::endl;
    		std::cout<<"Numéro de téléphone : "<<std::endl;
    		std::cin >> modifRech;
     
    		for(int i(0); i < Nbc; i++)
    		{
    			if (modifRech == Tel[i])
    			{
    				ValideTel = true;
    				break;
    			}
    			else
    			{	
    				ValideTel = false;
     
    			}
    		}
    	}
    }

    voila le message d'erreur que j'ai !

    System-Téléphonique.cpp: In function ‘void ValidationDonnee(int&, std::string, std::string*, int, int, int*, std::string, std::string)’:
    System-Téléphonique.cpp:207:36: error: no match for ‘operator==’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} and ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’})
    207 | if(nomRech == nom[i])
    In file included from /usr/include/x86_64-linux-gnu/c++/12/bits/c++allocator.h:33,
    from /usr/include/c++/12/bits/allocator.h:46,
    from /usr/include/c++/12/string:41,
    from /usr/include/c++/12/bits/locale_classes.h:40,
    from /usr/include/c++/12/bits/ios_base.h:41,
    from /usr/include/c++/12/ios:42,
    from /usr/include/c++/12/ostream:38,
    from /usr/include/c++/12/iostream:39,
    from System-Téléphonique.cpp:36:
    /usr/include/c++/12/bits/new_allocator.h:196:9: note: candidate: ‘template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)’
    196 | operator==(const __new_allocator&, const __new_allocator<_Up>&)
    | ^~~~~~~~
    /usr/include/c++/12/bits/new_allocator.h:196:9: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: mismatched types ‘const std::__new_allocator<_Tp>’ and ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’}
    207 | if(nomRech == nom[i])
    | ^
    In file included from /usr/include/c++/12/iosfwd:40,
    from /usr/include/c++/12/ios:38:
    /usr/include/c++/12/bits/postypes.h:192:5: note: candidate: ‘template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)’
    192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
    | ^~~~~~~~
    /usr/include/c++/12/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::fpos<_StateT>’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/allocator.h:219:5: note: candidate: ‘template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)’
    219 | operator==(const allocator<_T1>&, const allocator<_T2>&)
    | ^~~~~~~~
    /usr/include/c++/12/bits/allocator.h:219:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::allocator<_CharT>’
    207 | if(nomRech == nom[i])
    | ^
    In file included from /usr/include/c++/12/string:47:
    /usr/include/c++/12/bits/stl_iterator.h:444:5: note: candidate: ‘template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)’
    444 | operator==(const reverse_iterator<_Iterator>& __x,
    | ^~~~~~~~
    /usr/include/c++/12/bits/stl_iterator.h:444:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/stl_iterator.h:489:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)’
    489 | operator==(const reverse_iterator<_IteratorL>& __x,
    | ^~~~~~~~
    /usr/include/c++/12/bits/stl_iterator.h:489:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::reverse_iterator<_Iterator>’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/stl_iterator.h:1656:5: note: candidate: ‘template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)’
    1656 | operator==(const move_iterator<_IteratorL>& __x,
    | ^~~~~~~~
    /usr/include/c++/12/bits/stl_iterator.h:1656:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/stl_iterator.h:1726:5: note: candidate: ‘template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)’
    1726 | operator==(const move_iterator<_Iterator>& __x,
    | ^~~~~~~~
    /usr/include/c++/12/bits/stl_iterator.h:1726:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::move_iterator<_IteratorL>’
    207 | if(nomRech == nom[i])
    | ^
    In file included from /usr/include/c++/12/bits/stl_algobase.h:64,
    from /usr/include/c++/12/string:50:
    /usr/include/c++/12/bits/stl_pair.h:640:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)’
    640 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    | ^~~~~~~~
    /usr/include/c++/12/bits/stl_pair.h:640:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::pair<_T1, _T2>’
    207 | if(nomRech == nom[i])
    | ^
    In file included from /usr/include/c++/12/bits/basic_string.h:47,
    from /usr/include/c++/12/string:53:
    /usr/include/c++/12/string_view:540:5: note: candidate: ‘template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)’
    540 | operator==(basic_string_view<_CharT, _Traits> __x,
    | ^~~~~~~~
    /usr/include/c++/12/string_view:540:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::__cxx11::basic_string<char>’ is not derived from ‘std::basic_string_view<_CharT, _Traits>’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/string_view:546:5: note: candidate: ‘template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)’
    546 | operator==(basic_string_view<_CharT, _Traits> __x,
    | ^~~~~~~~
    /usr/include/c++/12/string_view:546:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::__cxx11::basic_string<char>’ is not derived from ‘std::basic_string_view<_CharT, _Traits>’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/string_view:569:5: note: candidate: ‘template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)’
    569 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
    | ^~~~~~~~
    /usr/include/c++/12/string_view:569:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: mismatched types ‘std::basic_string_view<_CharT, _Traits>’ and ‘char’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/basic_string.h:3575:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)’
    3575 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
    | ^~~~~~~~
    /usr/include/c++/12/bits/basic_string.h:3575:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>’ and ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’}
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/basic_string.h:3584:5: note: candidate: ‘template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const __cxx11::basic_string<_CharT>&, const __cxx11::basic_string<_CharT>&)’
    3584 | operator==(const basic_string<_CharT>& __lhs,
    | ^~~~~~~~
    /usr/include/c++/12/bits/basic_string.h:3584:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: mismatched types ‘const std::__cxx11::basic_string<_CharT>’ and ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’}
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/basic_string.h:3599:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)’
    3599 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
    | ^~~~~~~~
    /usr/include/c++/12/bits/basic_string.h:3599:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: mismatched types ‘const _CharT*’ and ‘char’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/basic_string.h:3640:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)’
    3640 | operator==(const _CharT* __lhs,
    | ^~~~~~~~
    /usr/include/c++/12/bits/basic_string.h:3640:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: mismatched types ‘const _CharT*’ and ‘std::__cxx11::basic_string<char>’
    207 | if(nomRech == nom[i])
    | ^
    In file included from /usr/include/c++/12/bits/locale_facets.h:48,
    from /usr/include/c++/12/bits/basic_ios.h:37,
    from /usr/include/c++/12/ios:44:
    /usr/include/c++/12/bits/streambuf_iterator.h:233:5: note: candidate: ‘template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)’
    233 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
    | ^~~~~~~~
    /usr/include/c++/12/bits/streambuf_iterator.h:233:5: note: template argument deduction/substitution failed:
    System-Téléphonique.cpp:207:44: note: ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} is not derived from ‘const std::istreambuf_iterator<_CharT, _Traits>’
    207 | if(nomRech == nom[i])
    | ^
    /usr/include/c++/12/bits/allocator.h:205:7: note: candidate: ‘bool std::operator==(const allocator<char>&, const allocator<char>&)’
    205 | operator==(const allocator&, const allocator&) _GLIBCXX_NOTHROW
    | ^~~~~~~~
    /usr/include/c++/12/bits/allocator.h:205:18: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::allocator<char>&’
    205 | operator==(const allocator&, const allocator&) _GLIBCXX_NOTHROW
    | ^~~~~~~~~~~~~~~~
    In file included from /usr/include/c++/12/bits/ios_base.h:46:
    /usr/include/c++/12/system_error:362:3: note: candidate: ‘bool std::operator==(const error_code&, const error_code&)’
    362 | operator==(const error_code& __lhs, const error_code& __rhs) noexcept
    | ^~~~~~~~
    /usr/include/c++/12/system_error:362:32: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_code&’
    362 | operator==(const error_code& __lhs, const error_code& __rhs) noexcept
    | ~~~~~~~~~~~~~~~~~~^~~~~
    /usr/include/c++/12/system_error:368:3: note: candidate: ‘bool std::operator==(const error_code&, const error_condition&)’
    368 | operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
    | ^~~~~~~~
    /usr/include/c++/12/system_error:368:32: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_code&’
    368 | operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
    | ~~~~~~~~~~~~~~~~~~^~~~~
    /usr/include/c++/12/system_error:376:3: note: candidate: ‘bool std::operator==(const error_condition&, const error_condition&)’
    376 | operator==(const error_condition& __lhs,
    | ^~~~~~~~
    /usr/include/c++/12/system_error:376:37: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_condition&’
    376 | operator==(const error_condition& __lhs,
    | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
    /usr/include/c++/12/system_error:408:3: note: candidate: ‘bool std::operator==(const error_condition&, const error_code&)’
    408 | operator==(const error_condition& __lhs, const error_code& __rhs) noexcept
    | ^~~~~~~~
    /usr/include/c++/12/system_error:408:37: note: no known conversion for argument 1 from ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} to ‘const std::error_condition&’
    408 | operator==(const error_condition& __lhs, const error_code& __rhs) noexcept


  2. #2
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    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 074
    Points : 12 120
    Points
    12 120
    Par défaut
    C'est dans le message d'erreur, même si vous nous avez pas donner tout le code, merci pour deviner la ligne 207 :
    System-Téléphonique.cpp:207:36: error: no match for ‘operator==’ (operand types are ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} and ‘__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type’ {aka ‘char’})
    207 | if(nomRech == nom[i])
    Le message indique que vous essayez de comparer une "std::string" à un "char".

    P.S.: pourquoi poster ici, vu que c'est pas du C++/CLI ?

  3. #3
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2017
    Messages
    67
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2017
    Messages : 67
    Points : 29
    Points
    29
    Par défaut Autre problème
    Citation Envoyé par bacelar Voir le message
    C'est dans le message d'erreur, même si vous nous avez pas donner tout le code, merci pour deviner la ligne 207 :


    Le message indique que vous essayez de comparer une "std::string" à un "char".

    P.S.: pourquoi poster ici, vu que c'est pas du C++/CLI ?

    Bonjour / bonsoir merci d'avoir répondu à mon message, mais j'ai une question pourquoi dite vous que ce n'est pas du C++/CLI c'est bien pourtant du C++ en mode console .... Par contre après revérification du code j'ai effectivement trouver l'erreur je n'avais pas mis les bon arguments dans la fonction, par contre après avoir rectifié j'ai une autre erreur que voici :

    g++: fatal error: no input files
    compilation terminated.

    le shell a retourné 1

    Appuyez sur ENTRÉE ou tapez une commande pour continuer
    /usr/bin/ld*: /tmp/ccGU6TET.o*: dans la fonction «*Recherche(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int*)*»*:
    System-Téléphonique.cpp.text+0x9b7)*: référence indéfinie vers «*ValidationDonnee(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)*»
    /usr/bin/ld*: System-Téléphonique.cpp.text+0xacd)*: référence indéfinie vers «*ValidationDonnee(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)*»
    /usr/bin/ld*: System-Téléphonique.cpp.text+0xbd1)*: référence indéfinie vers «*ValidationDonnee(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)*»
    collect2: error: ld returned 1 exit status

    le shell a retourné 1

    Appuyez sur ENTRÉE ou tapez une commande pour continuer


    Voila je vous merci d'avance pour votre réponse passer une bonne soirée/Journée...

  4. #4
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2017
    Messages
    67
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2017
    Messages : 67
    Points : 29
    Points
    29
    Par défaut Petit oublie
    Citation Envoyé par Aigle-Royal Voir le message
    Bonjour / bonsoir merci d'avoir répondu à mon message, mais j'ai une question pourquoi dite vous que ce n'est pas du C++/CLI c'est bien pourtant du C++ en mode console .... Par contre après revérification du code j'ai effectivement trouver l'erreur je n'avais pas mis les bon arguments dans la fonction, par contre après avoir rectifié j'ai une autre erreur que voici :

    g++: fatal error: no input files
    compilation terminated.

    le shell a retourné 1

    Appuyez sur ENTRÉE ou tapez une commande pour continuer
    /usr/bin/ld*: /tmp/ccGU6TET.o*: dans la fonction «*Recherche(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int*)*»*:
    System-Téléphonique.cpp.text+0x9b7)*: référence indéfinie vers «*ValidationDonnee(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)*»
    /usr/bin/ld*: System-Téléphonique.cpp.text+0xacd)*: référence indéfinie vers «*ValidationDonnee(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)*»
    /usr/bin/ld*: System-Téléphonique.cpp.text+0xbd1)*: référence indéfinie vers «*ValidationDonnee(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, int*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)*»
    collect2: error: ld returned 1 exit status

    le shell a retourné 1

    Appuyez sur ENTRÉE ou tapez une commande pour continuer


    Voila je vous merci d'avance pour votre réponse passer une bonne soirée/Journée...
    l'erreur semblait ce trouver à la ligne 113 : void ValidationDonnee(int& Nbc,std::string nom, std::string pren[], int choixRech, int modifRech,int Tel[], std::string nomRech, std::string prenRech) dans l'argument nom j'ai oublié de mettre les crochets.

  5. #5
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    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 074
    Points : 12 120
    Points
    12 120
    Par défaut
    c'est bien pourtant du C++ en mode console
    Vous vous trompez de "CLI".

    https://learn.microsoft.com/en-us/cp...?view=msvc-170

    Vous avez donc beaucoup moins de monde pour répondre à vos questions "généralistes" qui n'ont rien à voir avec C++/CLI.

    j'ai effectivement trouver l'erreur je n'avais pas mis les bon arguments dans la fonction, par contre après avoir rectifié j'ai une autre erreur que voici :
    Ouais, bof, déjà, utiliser des tableaux C à la place d'un std::vector ou un std::array C++, ça vous éviterait pas mal de conneries.

    Appuyez sur ENTRÉE ou tapez une commande pour continuer
    /usr/bin/ld*: /tmp/ccGU6TET.o*: dans la fonction «*Recherche(int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int*)*»*:
    C'est une erreur d'édition de lien, le plus probable, c'est que la signature d'une fonction est différente entre le .h et le .cpp.

    La compilation est passée donc le code (en multiple exemplaire : revoyez le concept de DRY, SVP) et conforme à la déclaration dans le .h:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ValidationDonnee(Nbc,nom[i],pren[i],choixRech,modifRech,Tel,  nomRech, prenRech);
    void ValidationDonnee(int& Nbc,std::string nom, std::string pren[], int choixRech, int modifRech
    On voit que le 3ème paramètre de la définition de ValidationDonnee ne colle pas avec les appels, donc avec la déclaration.
    Vous avez 2 "fonctions" ValidationDonnee, l'une juste déclarée, l'autre juste défini.

    Dégagez ces tableaux C, bordel !!!

  6. #6
    Nouveau membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2017
    Messages
    67
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2017
    Messages : 67
    Points : 29
    Points
    29
    Par défaut
    Citation Envoyé par bacelar Voir le message
    Vous vous trompez de "CLI".

    https://learn.microsoft.com/en-us/cp...?view=msvc-170

    Vous avez donc beaucoup moins de monde pour répondre à vos questions "généralistes" qui n'ont rien à voir avec C++/CLI.

    D'accord je vois merci.
    Ouais, bof, déjà, utiliser des tableaux C à la place d'un std::vector ou un std::array C++, ça vous éviterait pas mal de conneries.


    Oui vous avez raison, je regarderai à ça.

    C'est une erreur d'édition de lien, le plus probable, c'est que la signature d'une fonction est différente entre le .h et le .cpp.

    La compilation est passée donc le code (en multiple exemplaire : revoyez le concept de DRY, SVP) et conforme à la déclaration dans le .h:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ValidationDonnee(Nbc,nom[i],pren[i],choixRech,modifRech,Tel,  nomRech, prenRech);

    On voit que le 3ème paramètre de la définition de ValidationDonnee ne colle pas avec les appels, donc avec la déclaration.
    Vous avez 2 "fonctions" ValidationDonnee, l'une juste déclarée, l'autre juste défini.

    Dégagez ces tableaux C, bordel !!!
    D'accord je vois, ne vous fâché pas ! je prend note de vos conseils et je vais regarder à ça et ne soyez pas impoli ! Merci.

Discussions similaires

  1. Réponses: 3
    Dernier message: 18/03/2007, 21h50
  2. [Système] fonction enregistrement !
    Par sellyh2 dans le forum Langage
    Réponses: 2
    Dernier message: 19/02/2007, 16h09
  3. [Système] Partage d'un répertoire
    Par the java lover dans le forum API standards et tierces
    Réponses: 5
    Dernier message: 24/07/2006, 09h19
  4. creer un code sur changement d'enregistrement
    Par deglingo37 dans le forum Access
    Réponses: 6
    Dernier message: 22/05/2006, 09h42
  5. Réponses: 7
    Dernier message: 03/02/2005, 17h20

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