title: Can i define my own string type in pascal?
body: <p>I've read i can't really dynamically allocate an array in pascal but i'm also thinking of implementing a string struct.<br />
  In C, i would go about it by creating a <code>struct</code> containing a pointer to an array of chars (containing the characters), a length integer and a size one. I would then <code>malloc</code> the <code>char *</code> and <code>realloc</code> it when it needs to be resized.</p>
  <pre class="lang-c prettyprint-override"><code>typedef struct {
      size_t size;
      size_t length;
      char* contents;
  } String;
  </code></pre>
  <p>Can this be done in (ISO) pascal? If so, how would one go about it? I don't want to use a built-in pascal dynamic array because it kind of defeats the purpose of making my own string type.</p>
  <p>From comments, it seems like ISO pascal (both standard and extended) doesn't support such things. How do i do it in free pascal then?</p>