Bonsoir, je suis actuellement en train d'essayer de faire un petit programme mais je suis bloqué je n'arrive pas à faire en sorte que si l'utilisateur rentre un mot il soit vérifié par if enfin, regardez, vous comprendrez surement 
#include <iostream>
using namespace std;
int pythagore(double ab, double bc)
{
double matches((ab*ab) + (bc*bc));
return matches;
}
int main()
{
cout << "Bienvenue dans le programme de calcul de soso !" << endl;
cout << "Veuillez avant tout choisir ce que vous voulez faire" << endl;
cout << "pythagore, carre, addition (5 nombres max) ?" << endl;
string choix("null");
cin >> choix;
if (choix = "pythagore")
{
double ab(0),bc(0),ac(0);
cout << "Triangle ABC rectangle en B." << endl;
cout << "AB = ?" << endl;
cin >> ab;
cout << "BC = ?" << endl;
cin >> bc;
ac = pythagore(ab,bc);
cout << "le resultat est " << ac << endl;
}
else
{
cout << "error: null" << endl;
}
return 0;
}
Le programme me renvoie :
||=== Build: Debug in test_multifonction (compiler: GNU GCC Compiler) ===|
C:\C++\test_multifonction\main.cpp||In function 'int main()':|
C:\C++\test_multifonction\main.cpp|26|error: invalid conversion from 'int (*)(double, double)' to 'char' [-fpermissive]|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|562|error: initializing argument 1 of 'std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc> = std::basic_string<char>]' [-fpermissive]|
C:\C++\test_multifonction\main.cpp|26|error: could not convert 'choix.std::basic_string<_CharT, _Traits, _Alloc>::operator=<char, std::char_traits<char>, std::allocator<char> >(((int)((char)((int)pythagore))))' from 'std::basic_string<char>' to 'bool'|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Je précise que commence depuis peu le C++
Merci d'avance pour vos réponses 
Message édité le 25 mai 2015 à 22:52:17 par NBKL