Hullo, I need help here I can't get this to work. I'm not sure if the code is correct. Any help would be most appreciated. I basically wanna convert a std::string to a const char array.
#include <string>
#include <iostream>
void bull(char[]);
int main()
{
std::string Yo_momma = "iz fat";
bull(Yo_momma.c_str()); //<--error here
std::cin.get();
return 0;
}
void bull( char crap[] )
{
std::cout << crap;
}
My errors...
In function `int main()':
invalid conversion from `const char*' to `char*'
initializing argument 1 of `void bull(char*)'
I'm using windows xp and Dev-cpp
God bless.