Top "Strcpy" questions

The C standard library function, "strcpy()," is used to copy non-overlapping, null-terminated strings.

Strcpy implementation in C

So, I have seen this strcpy implementation in C: void strcpy1(char dest[], const char source[]) { int i = 0; while (1) { dest[…

c strcpy
'strcpy' with 'malloc'?

Is it safe to do something like the following? #include <stdio.h> #include <malloc.h> #include &…

c malloc strcpy
C strcpy() - evil?

Some people seem to think that C's strcpy() function is bad or evil. While I admit that it's usually better …

c memcpy strcpy
Copy unsigned char array

What would be the best way to copy unsigned char array to another? For example: unsigned char q[1000]; unsigned char …

c string strcpy unsigned-char
How does strcpy_s work?

As we all know, strcpy_s is a safety version of strcpy. But I wonder how it works ... let's see …

c string strcpy
Alternative of strcpy in c++

In C i used strcpy to make a deep copy of a string, but is it still 'fine' to use …

c++ deep-copy strcpy
"Abort trap: 6" error in C?

I'm a beginner to C but I have this code running on xcode through gcc on terminal: #include <stdio.…

c arrays strcpy
How to copy or concatenate two char*

How do you concatenate or copy char* together? char* totalLine; const char* line1 = "hello"; const char* line2 = "world"; strcpy(totalLine,…

c++ strcpy strcat
Why is strcpy unsafe in C?

I am a beginner, and I am learning how to copy a string in C now. Here is a problem …

c string strcpy
Why must a pointer to a char array need strcpy to assign characters to its array and double quotes assignment will not work?

The first example does not work when you go to delete the pointer. The program either hangs when I add …

c++ arrays string char strcpy