Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Convert std::string to char[]

$
0
0

//My function is for converting std::string to char[]

void stringConvertToChar(string& str,char arr[]) //To convert std::string to char[] { char *y = new char[str.length() + 1]; strcpy_s(y, str.c_str()); strcpy_s(arr,y); return; }

error: strcpy_s doe'snt accept 2 arguments.

i used strcpy_s as when i used strcpy(), the compiler was giving a warning of depriciated strcpy.

Please help!



Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>