About 2,820,000 results
Open links in new tab
  1. c - strcpy () return value - Stack Overflow

    A lot of the functions from the standard C library, especially the ones for string manipulation, and most notably strcpy(), share the following prototype: char *the_function (char *destination, .....

  2. Why should you use strncpy instead of strcpy? - Stack Overflow

    30 strncpy is NOT safer than strcpy, it just trades one type of bugs with another. In C, when handling C strings, you need to know the size of your buffers, there is no way around it. …

  3. c - strcpy vs. memcpy - Stack Overflow

    May 24, 2010 · 101 What is the difference between memcpy() and strcpy()? I tried to find it with the help of a program but both are giving the same output.

  4. string - Why is strcpy unsafe in C? - Stack Overflow

    Apr 27, 2014 · Every time I try to use "strcpy" command to copy from string 1 to string 2, Visual Studio 2013 will give me an error/warning message saying that "strcpy" is unsafe and suggest …

  5. c - Correct way to use strcpy () function? - Stack Overflow

    What is the correct way to use strcpy() function? I have done it in two ways, and both times the program worked just fine, so I was wondering what's "more correct" way to use it. I want to …

  6. c - strncpy or strlcpy in my case - Stack Overflow

    1 You should always the standard function, which in this case is the C11 strcpy_s() function. Not strncpy(), as this is unsafe not guaranteeing zero termination. And not the OpenBSD-only …

  7. C言語の文字列コピーをvisual studioで実行するとstrcpyの部分が …

    strcpy_s を使用して、11文字を10文字バッファーにコピーしようとすると、これはエラーになります。 strcpy_s でこの間違いを訂正することはできませんが、このエラーを検出して、無 …

  8. string - C - why is strcpy () necessary - Stack Overflow

    40 Can someone please explain to me why strcpy () is necessary to assign strings to character arrays, such as in the following code snippet.

  9. c - how to use strncpy correctly? - Stack Overflow

    Sep 6, 2018 · This use of strncpy defeats the purpose, and is really no better than than a simple call to strcpy. The only practical use for strncpy, is if you want to overwrite a part of the string …

  10. how to force compiler error with strcpy() when destination is const

    Jul 16, 2025 · I then tried adding an additional selector for an array, char []: strcpy((d),(s)), \, with a couple of syntax variations, char [] and char[*], which resulted only in compiler errors. Plus …