Hello group,
Could anyone of you tell me how to convert string to const char* in C ....function c_str() is not working ...i dont know why............
Thanks...

>Could anyone of you tell me how to convert string to const char* in C

const char *p = my_string;

>function c_str() is not working
Are you working with C or C++? Make up your mind. C doesn't have a string type, and C++'s string type is incompatible with C.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.