Answers for "how to copy string into char array in c"

C
1

c modify char array

char name_buf[5] = "Bob";
name_buf = "Alice";   // error
strcpy(name_buf, "Alice");
Posted by: Guest on August-24-2020
0

how to input a string into a char array cpp

strcpy(my_array, my_string.c_str());
Posted by: Guest on August-26-2020

Code answers related to "how to copy string into char array in c"

Code answers related to "C"

Browse Popular Code Answers by Language