When I use a) the wsprintf_s and wcsncat_s functions work fine, but when I use b) the swprintf_s works and wcsncat_s does not.
My issue:
I thought by using a) and inputting buf to wcsncat_s was inputting a pointer to an array. So why am I having an issue using b) by inputting a pointer to an array? see my problem?
P.S compiler says: No Instance of overloaded function "wcsncat_s" matches the argument list.
You are trying to use the second version, but that only works with array defined at compile time.
For your dynamic array, you need to use the first version.
On a side note: If you are new to C++ programming, I would highly recommend to forget about those C-style ways of working with strings and switch to the C++ style of doing strings Use classes like std::string and std::stringstream.
Bookmarks