| | |
How to convert string to const char* in C
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
>Could anyone of you tell me how to convert string to const char* in C
>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.
C++ Syntax (Toggle Plain Text)
const char *p = my_string;
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.
I'm here to prove you wrong.
![]() |
Similar Threads
- first cannot conver std::string to const char, now runtime error! (C++)
- converting std::string to const chars? (C++)
- convert int back to char (C)
- Converting Int to Const Char (C)
Other Threads in the C++ Forum
- Previous Thread: Problems with cin (char arrays|strings)
- Next Thread: Code compatability problem
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






