Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iString::iString(const char * chars)
- {
- if(chars)
- {
- length = strlen(chars);
- capacity = length + 10 + 1;
- this->chars = new char[capacity];
- strcpy(this->chars, chars);
- }
- else
- {
- length =0;
- this->chars = NULL;
- capacity = 0;
- }
- }
- iString::iString(const iString & other) : length(other.length), capacity(other.capacity)
- {
- if(capacity != 0)
- {
- chars = new char[capacity];
- strcpy(chars, other.chars);
- }
- else
- {
- chars = NULL;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement