1 2 3 4 5 6 7 8 9 10 11 12 13 14
| void recup(char*resolut_char,char*type,const char*chaine)
{ /**le compilateur (Devc++ m'indique une erreur* ici**/
std::string::size_type pos,pos2;
std::string fic=(chaine);
std::string type_str=(type);
fic.erase(std::remove(fic.begin(), fic.end(), 32), fic.end());
type_str += "=\"";
pos = fic.find(type)+type_str.length();
pos2 = fic.find_first_of("\"",pos);
std::string resolut(fic,pos, pos2-pos);
size_t size = resolut.size() + 1;
resolut_char = new char[ size ];
strncpy( resolut_char, resolut.c_str(), size );
} |
Partager