Paul99
235Messages postés
25 juillet 2007Date d'inscription
16 juin 2010Dernière intervention
5 août 2008 à 15:20
Oups, désolé, mon code amélioré ne fonctionnait pas. Je viens d'essayer avec ta version, le debugueur se fait bavard :
In file included from dico.h:6,
from code.h:5,
from main.cpp:4:
dico.cpp: In function ‘std::string rch(std::string, std::string, std::string)’:
dico.cpp:18: erreur: no matching function for call to ‘std::basic_string<char, std::char_traits<char>, std::allocator<char> >::replace(int&, int&, std::string&, size_t)’
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../../include/c++/4.3.0/bits/basic_string.h:1194: note: candidats sont: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::replace(typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../../include/c++/4.3.0/bits/basic_string.h:1217: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::replace(typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const std::basic_string<_CharT, _Traits, _Alloc>&, typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../../include/c++/4.3.0/bits/basic_string.tcc:390: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::replace(typename _Alloc::rebind<_CharT>::other::size_type, typename _Alloc::rebind<_CharT>::other::size_type, const _CharT*,
Et ainsi de suite...
Si la suite du rapport peut aider il faut me le dire, mais ça m'étonnerait.
Sinon, la concaténation rajoute des caractères à la fin, mais ne transforme pas (enfin je pense, ne pas hésiter à me corriger !!). Et sinon, a quoi ressemble la technique des "itérateurs" ? Je ne vois pas vraiment...
En tous cas, merci !