How to copy a string onto another

Hi,

In given example in help page :

  char Str1[15];
  char Str2[8] = {'a', 'r', 'd', 'u', 'i', 'n', 'o'};
  char Str3[8] = {'a', 'r', 'd', 'u', 'i', 'n', 'o', '\0'};
  char Str4[ ] = "arduino";
  char Str5[8] = "arduino";
  char Str6[15] = "arduino";

In program, I can't find how to copy Str6 to Str1 !!!

I tried something like this :
Str1 = Str6;
or Str1 = Str6;
but returns a compilation error.

I guess it's very simple but couldn't find how to do this, even after reading and browsing pages and pages!

Thanks.

strcpy(str1, str6);

1 Like

Ok, thanks.

It's amazing that's not mentionned in arduino help file.
I have search in it but didn't found it !!!
If it exists, it's deeply hidden...

It's amazing that's not mentionned in arduino help file.

The Arduino reference is just that, a reference to Arduino specific functions. It is not meant to be a reference to the whole of C++ but there are plenty of those online.