•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 426,920 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,358 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 12029 | Replies: 1
![]() |
>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.
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 a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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



Linear Mode