Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

string to char*

Status
Not open for further replies.

hectorDUQUE

Programmer
Jan 29, 2007
23
hi guys,
i am getting problems trying to convert a c++ basic string to a char * (C languaje).

error: cannot convert ‘std::string’ to ‘char*’ for argument ‘1’ to ‘void hD_readIniFile(char*, map_group_type&, map_groupFN_type&)’

Code:
  string fn_ch(*cur_edge);
  hD_readIniFile(fn_ch, groupOfNumbers, groupsFN);

is there a function to convert this ?

thanks in advance

hector


Inappropriate post?
 
Code:
  string fn_ch( *cur_edge );
  hD_readIniFile( fn_ch[b].c_str()[/b], groupOfNumbers, groupsFN );
 
> void hD_readIniFile(char*
Is it really char* (the string can be modified), or can you make it const char *.

Unless it is const char *, then cpjust's answer is closer, but still won't work.


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top