C++ convert char to const char*

后端 未结 5 1193
情歌与酒
情歌与酒 2020-12-10 03:42

Basically i just want to loop through a string of characters pull each one out and each one has to be of type const char* so i can pass it to a function. heres a example. Th

5条回答
  •  臣服心动
    2020-12-10 04:31

    string sym(1, thestring[i]);
    theval = sym.c_str();
    

    It gives a null-terminated const char* for every character.

提交回复
热议问题