Of course it works for me. The function expects a c-style string buffer though. I know I can use string::c_str() to get the cstring representation of the std::string, but...
I don't know. I started out with a char array buffer before I learned of that function, and I'm too lazy to change it back now.