strcopy()
Description
Create a copy of a string.
Syntax
strcopy(dest[], source[]);
Parameters
Variable | Input |
|---|---|
| The buffer to store the copy of the string string in |
| The string to copy, this may be a packed or an unpacked string |
Returns
The number of characters copied.
Function call example
Example of copying string
new copy_array[25]=''this will be copied'';
new duplicate_array[25];
main(){
strcopy(duplicate_array,copy_array); // copy_array will be placed into duplicate_array
while(1){
Delay(1000); // Delay 1 sec.
}
}Notes and Warnings
This function copies a string from source to dest. If the source string is a packed string, the destination will be packed too; likewise, if the source string is unpacked, the destination will be unpacked too. See functions strpack and strunpack to convert between packed and unpacked strings.