strcpy and strcpy_s

Hey guys ..
every time i use strcpy in my program i get a warning .. not an error but just a warning .. and i have to get rid of these warning ..
I have a note saying that i should use the strcpy_s function ..
however when i use it i'm getting that it accept only one argument ..
So can somebody please explain me the input arguments of this function ?
i tried to search the reference but i didn't get it ..
thanks alot

Hi there,

If you are using C++, I would advise using std::string over the old C-style strings. It will make your life a lot easier. However, the MSDN reference states that it takes multiple arguments:

MSDN wrote:
strDestination
Location of destination string buffer
numberOfElements
Size of the destination string buffer.
strSource
Null-terminated source string buffer


Source (with examples): http://msdn.microsoft.com/en-us/library/td1esda9%28v=vs.90%29.aspx

If you still have any problems, please copy the exact compiler error you are getting as well as the relevant part of your code.

All the best,
NwN
hah49 wrote:
i have to get rid of these warning ..
There should be option in the compiler options "stop forcing to use unportable "safe" function which actually not safer at all"

Name would be different, but with the same meaning ;)
Topic archived. No new replies allowed.