You need to convert grto std::stringbefore you can add it to another line. Prior to C ++ 11, you can use std::ostringstream, for example:
#include <sstream>
std::ostringstream oss_gr;
oss_gr << gr;
dossier.open("C:/Users/titib/Contacts/Desktop/Projet informatique/groupe/" + oss_gr.str() + "/" + utilisateur + ".txt");
Or, if you are using C ++ 11 or later, instead std::to_string():
dossier.open("C:/Users/titib/Contacts/Desktop/Projet informatique/groupe/" + std::to_string(gr) + "/" + utilisateur + ".txt");
Alternatively, in any version of C ++ you can use std::ostringstringto format the whole path:
std::ostringstream oss_path;
oss_path << "C:/Users/titib/Contacts/Desktop/Projet informatique/groupe/" << gr << "/" << utilisateur << ".txt";
dossier.open(oss_path.str());