probleme de pointeur avec une string
Bonjour a tous,
Ma solution contient un projet LogTools qui devient une dll et un projet Test qui me sert a tester cette dll. Je suis sur Visual Studio 2008
Dans ma solution test, j'ai :
Code:
1 2 3 4 5 6
|
int main()
{
string c = "C:\\Users\\monNom\\Documents\\";
logTools.createLog(false,"","",0,c); |
Cote LogTools, y'a :
Code:
1 2 3 4
|
bool LogTools::createLog(bool man, std::string srvManName, std::string typeSrv, const int serverRank, std::string repLogInfra)
{
repLogInfra = repLogInfra + "padidoum"; |
J'obtiens :
Unhandled exception at 0x000007fefd4b940d in TheTestingProject.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012d3a0..
En fait, je ne peux tout simplement pas acceder a ma valeur "repLogInfra".
Si je passe ma souris sur la variable lors d'un debug comme on fait pour avoir la valeur, il m'indique <bad ptr>
Je trouve ca tres etrange, vous auriez une idee ?