943,962 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 41158
  • C++ RSS
Jul 4th, 2006
1

How to convert string to const char* in C

Expand Post »
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...
Similar Threads
Reputation Points: 13
Solved Threads: 0
Newbie Poster
paramveer is offline Offline
8 posts
since Jun 2006
Jul 4th, 2006
0

Re: How to convert string to const char* in C

>Could anyone of you tell me how to convert string to const char* in C
C++ Syntax (Toggle Plain Text)
  1. 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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Problems with cin (char arrays|strings)
Next Thread in C++ Forum Timeline: Code compatability problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC