Fixed length string using templates
<p>So I have an assignment for school that requires me to create a fixed length string class using templates for use as part of a larger project but I'm having trouble getting started with the fixed length string so I thought I'd come here for help. I don't have much experience with templates which is what is causing me problems. My current problem is in the copy constructor which is giving me errors I don't know how to deal with. So here is my class definitions:</p>

<pre><code>template &lt;int T&gt;
    class FixedStr
    {
    public:
                            FixedStr        ();
                            FixedStr        (const FixedStr&lt;T&gt; &amp;);
                            FixedStr        (const string &amp;);
                            ~FixedStr       ();
        FixedStr&lt;T&gt; &amp;       Copy            (const FixedStr&lt;T&gt; &amp;);
        FixedStr&lt;T&gt; &amp;       Copy            (const string &amp;);

    private:
        string Data;
    };
</code></pre>

<p>And here is the copy constructor that is giving me problems:</p>

<pre><code>template &lt;int T&gt;
    FixedStr&lt;T&gt;::FixedStr (const string &amp; Str)
    {
        if (Str.length() == &lt;T&gt;)
            strcpy (FixedStr&lt;T&gt;.Data, Str);
    }
</code></pre>

<p>Can anyone give me some advice as to how to handle this? Is there are easy error you see or am I approaching the problem the wrong way? Thanks for any help you can give me.</p>
