copy string

Hi,

Please go through the code

//code snipet

#include <string.h>

char str[10] = "Welcome"
char str1[10] = "";

strcpy(str1,str);

How can I perform the above purely in C++ without using C string functions.strcpy is C function.

Regards,
Sanjib
1
2
3
4
5
#include <string>
[...]
string str="Welcome";
string str2;
str2=str;
Topic archived. No new replies allowed.