Copying strings in C++
Here is a good example on why either you love C++ or hate it with such terse expression oriented code; I think its pretty cool. If you want to copy one string to another, one option can be something like this. 1 2 3 4 5 6 void mycopy(char *p, char *q) { int len = strlen(q); for(int i=0; i<=len; i++) p[i] = q[i]; } However this achieves the same thing as above and is more efficient: ...