constattached to a parameter means that the parameter
will not change. In this case it means that the parameter
StrOrig cannot be an L-value within the strcpy function.
Thus it can provide valuable protection and assurance that
the copy will not be in the opposite direction!
So what is happening here?
Let us consider an example
char* s = "My sample string";
String tmp;// char* tmp;
strcpy (tmp, s);// tmp has a copy of s
First this is not the simple case in which tmp simply points
to the original string s, as in:
why on earth would we need strcpy to do this?
strcpy() actually does something like:
|