Problème Cast char* en std::string
Hello tout le monde,
Il y a une variable en char* qui doit être convertie en std::string
Le code est environ celui-ci:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
...
...
char* chProgFullPath = "C:\WINDOWS\NOTEPAD.EXE";
std::string stdPath = chProgFullPath;
md5 = new md5wrapper();
programHashValue = md5->getHashFromFile(stdPath);
...
...
std::string getHashFromFile(std::string filename)
{
FILE *file;
...
...
} |
J'ai pu voir dans différents exemples où std::string path = chProgFullPath était utilisé...
Dans mon cas, j'arrive à compiler, aucune erreur de building, mais si j'affiche la valeur de stdPath j'obtiens la valeur NULL.
Cela fait une journée que j'ai tout essayé et rien n'y fait...
@+
InovaH