How to convert string to const char* in C

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2006
Posts: 8
Reputation: paramveer is an unknown quantity at this point 
Solved Threads: 0
paramveer paramveer is offline Offline
Newbie Poster

How to convert string to const char* in C

 
1
  #1
Jul 4th, 2006
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...
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,740
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 739
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

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

 
0
  #2
Jul 4th, 2006
>Could anyone of you tell me how to convert string to const char* in C
  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.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC