Using strcpy() : string function « Data Types « C++ Tutorial






#include <iostream>
 #include <string.h>
 
 int main()
 {
     char String1[] = "test";
     char String2[80];
 
     strcpy(String2,String1);
 
     std::cout << "String1: " << String1 << std::endl;
     std::cout << "String2: " << String2 << std::endl;
     return 0;
 }
String1: test
String2: test








2.24.string function
2.24.1.Using strcpy()
2.24.2.Using strncpy()
2.24.3.strcpy, strlen, strcmp, strcat
2.24.4.Convert a string to uppercase.
2.24.5.Using strcat and strncat.
2.24.6.Using strcmp and strncmp
2.24.7.Using strtok
2.24.8.Using strlen