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:
Location of destination string buffer
Size of the destination string buffer.
Null-terminated source string buffer

Source (with examples):

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,
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.