| | | | | |

C String Functions

  • possible implementation of operator <<()
  • ostream& operator << (ostream& os, char* str)
    {
      while (*str != '\0')
      {
        os.put(*str);
        ++str;
      }
      return os;
    }
  • How is assumption of null-termination used ?
  • How is assumption of memory allocation used?
  • What happens if assumptions are not valid?

| | Top of Page | 3. C Strings, Proper Type, and String Objects - 3 of 17