
cstr
By: a guest on
Oct 22nd, 2012 | syntax:
C++ | size: 0.23 KB | hits: 36 | expires: Never
#include <string>
#include <iostream>
using namespace std;
void some_function(string str)
{
cout << "str : " << str.c_str() <<endl;
}
int main() {
const char* cstr = "Hello World!";
some_function(string(cstr));
}