About 10,000,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. Use the STRCPY C - Stack Overflow

    Feb 13, 2014 · 9 The call strcpy(&string[0],&string[1]); means: copy the NULL-terminated string starting at the address of string [1] to the address of string [0]. This means you are copying the string starting …

  3. 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. strncpy was justified for …

  4. c - strcpy vs. memcpy - Stack Overflow

    May 24, 2010 · strcpy vs. memcpy Asked 15 years, 6 months ago Modified 2 years, 4 months ago Viewed 141k times

  5. string - C++: strcpy Function copies null? - Stack Overflow

    The strcpy function copies the string pointed to by s2 (including the terminating null character) into the array pointed to by s1. If copying takes place between objects that overlap, the behavior is undefined.

  6. 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 …

  7. 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 strlcpy(), …

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

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

  10. 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 me to use …