Original Post
I''m developing my own string class just for the fun of it. In past projects I''ve learned the value of copying over character arrays instead of just pointing to them. For example:
mystring hello = "Hello";In the "=" operator, I know that I shouldn''t just point the internal character array to the passed in char pointer. This is because it''s allocated on the heap and will be destroyed.. causing problems. So in the "=" operator, should I allocate char space and then do a strcpy? How does the string class (#include <string>) do it? Thanks.