strcat_s question [modified]
-
I want to add a "-" to an existing string: char* sOutString = new char[stringSize]; strcat( sOutString, "-" ); // Results in Warning but use the new function to avoid the deprecation warning: strcat_s( sOutString, stringSize, "-" ); But, this is apperently not correct as it crashes on this line. What am I doing wrong and how to I fix it? EDIT: The above does work... I just did something wrong. All working now. Thx.
-
I want to add a "-" to an existing string: char* sOutString = new char[stringSize]; strcat( sOutString, "-" ); // Results in Warning but use the new function to avoid the deprecation warning: strcat_s( sOutString, stringSize, "-" ); But, this is apperently not correct as it crashes on this line. What am I doing wrong and how to I fix it? EDIT: The above does work... I just did something wrong. All working now. Thx.
Your core problem is that you're using C. If you're using C++, use the string class. If you're using C++/CLI, consider the String class. Either way, this question is about C or C++, and this is the C++/CLI forum
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )