Converting char * into the string?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Converting char * into the string?

Kevin Peterson

I have a function which takes string as an argument, but while calling this function I am actually passing char * (not const char *). This function uses the argument and populate the private variable which is of string type.

In the product its showing some strange behaviour i.e. crashing once in a while (not always) in other function while accessing the string variable which is class variable. Just want to check if the issue is with the passing of the variable which is of char * type.

    void myfunc(char * Id)

    Definition of the fetchInfo
    fetchInfo(std::string Id);

Kevin Peterson

help-gplusplus mailing list
[hidden email]