Questions tagged [strcpy]

The C standard library function, "strcpy()," is used to copy non-overlapping, null-terminated strings. It is also defined as "std::strcpy()" in the C++ standard library.

Used to copy null-terminated, non-overlapping strings, it is defined in the <string.h> standard header. It is also defined in the C++ standard library in the <cstring> header.

Documentation for C strcpy.

Documentation for C++ std::strcpy.

947 questions
-7
votes
1 answer

C++ How to fill a char* array of strings with new values using c_str() on top of old ones

I have a static array which I only need to update in certain areas. char* MapIds[5000] = { "Northeast Asia","Hanyang","Pusan","Pyongyang","Shanghai","Beijing","Hong Kong" /* 4999 more stuff */ }; I have a mapName which is a JSON Object it can give…
SSpoke
  • 5,656
  • 10
  • 72
  • 124
-8
votes
1 answer

Out of program of C language of pointer and Strcpy

Consider the following C code snippet: char *sentence = NULL; strcpy(sentence, "Helloworld"); printf ("%s", sentence); is the code segment correct or error? If correct what is the output? a) Error b) Helloworld c) Null.Helloworld d) None of the…
1 2 3
63
64