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
    Membre confirm�
    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
    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 confirm�
    Homme Profil pro
    D�veloppeur informatique
    Inscrit en
    F�vrier 2005
    Messages
    5 504
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 53
    Localisation : France, Val de Marne (�le de France)

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

    Informations forums :
    Inscription : F�vrier 2005
    Messages : 5 504
    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
    Membre confirm�
    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
    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
    Membre confirm�
    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
    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 confirm�
    Homme Profil pro
    D�veloppeur informatique
    Inscrit en
    F�vrier 2005
    Messages
    5 504
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 53
    Localisation : France, Val de Marne (�le de France)

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

    Informations forums :
    Inscription : F�vrier 2005
    Messages : 5 504
    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
    Membre confirm�
    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
    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