<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Telefonbuchprogramm]]></title><description><![CDATA[<p>So ich mach grad das Projekt aus dem Volkard Tutorial durch (Telefonbuchprogramm). Eigentlich funktioniert alles, aber ab dem Moment, wenn ich dem vector (selber gebastelt NUR ZUR ÜBUNG!!!)einen Wert zuweisen möchte dann klappt es nicht mehr und es kommen ganz viele Errors.<br />
Ich glaub das liegt irgendwie an meinen &quot;templats&quot; und besonders mit dem &quot;template&quot; von der Klasse &quot;size&quot;. Und es könnte vll. auch an der Vererbung liegen, die Klasse vector erbt die Methoden von der Klasse size. Is das noch ganz koscher? Oder war des nä blöde Idee?<br />
So gesehen sind die ja auch nicht miteinander verwandt, aber es gibt ja auch abstrakte Datentypen, also kann man das auch vererben??<br />
Also irgendwie blick ich des net. Ich glaub da is sicher n Fehler mit dem template von der Klasse size bei dem übergang mit der vererbung... aber so genau weiß ichs irgendwie odch nicht!?<br />
Hier einfach mal der Code+Erros wahrschenilich bin ich einfach schon zu müde <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Wer noch wach ist und Lust hat --&gt; HAU REIN <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>main.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;vector.hpp&quot;
#include &quot;set.hpp&quot;
using namespace std;

int main()
{
	cout &lt;&lt; &quot;   MEN\x9a \n&quot;;
	cout &lt;&lt; &quot;''''''''''''''''''\n\n&quot;;
	cout &lt;&lt; &quot;[1] Name Suchen\n&quot;;
	cout &lt;&lt; &quot;[2] Neuer Name\n&quot;;
	set&lt;int&gt; data_base;
	data_base.insert(55); //&lt;-- ohne die Zeile geht alles ohne Errors oder Warnungen

	return 0;
}
</code></pre>
<p>vector.hpp</p>
<pre><code class="language-cpp">#ifndef VECTOR_HPP_INCLUDED
#define VECTOR_HPP_INCLUDED

#include &quot;size.hpp&quot;

template &lt;class T&gt;
class vector : public size&lt;T&gt;
{
    public:
    vector(int size);
    vector(const vector &amp;rhs);
    ~vector();
    int GetSize() {return m_size;}
    T &amp;operator[] (int index);
    vector &amp;operator= (const vector &amp;rhs);
    void grow(int fields);
    void moveDown(int pos); //ohne Nullstelle!!!
    private:
    T *m_data;
    size_t m_size;
};

template &lt;class T&gt;
vector&lt;T&gt;::vector(int size)
:m_size(size)
{
    m_data=new T[m_size];
}

template &lt;class T&gt;
vector&lt;T&gt;::vector(const vector &amp;rhs)
:m_size(rhs.m_size)
{
    m_data=new T[m_size];
    for (int i=0;i&lt;m_size;i++)
    {
        m_data[i]=rhs.m_data[i];
    }
}

template &lt;class T&gt;
vector&lt;T&gt;::~vector()
{
    delete []m_data;
}

template &lt;class T&gt;
T &amp;vector&lt;T&gt;::operator[] (int index)
{
    return m_data[index];
}

template &lt;class T&gt;
vector&lt;T&gt; &amp;vector&lt;T&gt;::operator= (const vector &amp;rhs)
{
    if (&amp;rhs!=this)
    {
        delete []m_data;
        m_data=NULL;
        m_size=rhs.m_size;
        m_data=new T[m_size];
        for (int i=0;i&lt;m_size;i++)
        {
            m_data[i]=rhs.m_data[i];
        }
    }
    return *this;
}

template &lt;class T&gt;
void vector&lt;T&gt;::grow(int fields)
{
    change_size(m_data,m_size,fields);
}

template &lt;class T&gt;
void vector&lt;T&gt;::moveDown(int pos)
{
    for (int i=pos-1;i&lt;m_size;i++)
    {
        m_data[i]=m_data[i+1];
    }
    m_size--;
}

#endif // VECTOR_HPP_INCLUDED
</code></pre>
<p>size.hpp</p>
<pre><code class="language-cpp">#ifndef SIZE_HPP_INCLUDED
#define SIZE_HPP_INCLUDED

#include &lt;iostream&gt;
#include &lt;string&gt;

template &lt;class T&gt;
class size
{
    public:
    size();
    virtual ~size();
    void change_size(T &amp;array,int length_old,int extension);
};

template &lt;class T&gt;
size&lt;T&gt;::size()
{

}

template &lt;class T&gt;
size&lt;T&gt;::~size()
{

}

template &lt;class T&gt;
void size&lt;T&gt;::change_size(T &amp;array,int length_old,int extension)
{
    T *cache=new T[length_old];
    for (int i=0;i&lt;length_old;i++)
    {
        cache[i]=array[i];
    }
    delete []array;
    array=NULL;
    array=new T[length_old+extension];
    for (int i=0;i&lt;(length_old+extension);i++)
    {
        array[i]=cache[i];
    }
    delete []cache;
}

#endif // SIZE_HPP_INCLUDED
</code></pre>
<p>set.hpp</p>
<pre><code class="language-cpp">#ifndef SET_HPP_INCLUDED
#define SET_HPP_INCLUDED

#include &quot;vector.hpp&quot;

template &lt;class T&gt;
class set
{
    public:
    set();
    ~set();
    T *find(const T &amp;toFind);
    bool has(const T &amp;toFind);
    void insert(const T &amp;toInsert);
    void remove(const T &amp;toRemove);

    private:
    int findIndex(const T &amp;toFind);
    vector&lt;T&gt; m_data;
    int m_size;
};

template &lt;class T&gt;
set&lt;T&gt;::set()
:m_data(10)
{
    m_size=10;
}

template &lt;class T&gt;
set&lt;T&gt;::~set()
{

}

template &lt;class T&gt;
T *set&lt;T&gt;::find(const T &amp;toFind)
{
    int found=findIndex(toFind);
    if (found!=-1)
    {
        return &amp;m_data[found];
    }
    else
    {
        return 0;
    }
}

template &lt;class T&gt;
bool set&lt;T&gt;::has(const T &amp;toFind)
{
    return find(toFind)!=0;
}

template &lt;class T&gt;
void set&lt;T&gt;::insert(const T &amp;toInsert)
{
    if (!has(toInsert))
    {
        if (m_size==m_data.GetSize())
        {
            m_data.grow(10);
        }
        m_data[m_size]=toInsert;
        m_size++;
    }
}

template &lt;class T&gt;
int set&lt;T&gt;::findIndex(const T &amp;toFind)
{
    for (int i=0;i&lt;m_size;i++)
    {
        if (toFind==m_data[i])
        {
            return i;
        }
    }
    return -1;
}

template &lt;class T&gt;
void set&lt;T&gt;::remove(const T &amp;toRemove)
{
    int found=findIndex(toRemove);
    if (found!=-1)
    {
        m_data.moveDown(found);
    }
}

#endif // SET_HPP_INCLUDED
</code></pre>
<p>ERRORS:</p>
<blockquote>
<p>-------------- Build: Debug in Telefonbuch ---------------<br />
Compiling: main.cpp<br />
vector.hpp: In member function <code>void vector&lt;T&gt;::grow(int) \[with T = int\]': set.hpp:63: instantiated from</code>void set&lt;T&gt;::insert(const T&amp;) [with T = int]'<br />
main.cpp:13: instantiated from here<br />
vector.hpp:75: error: no matching function for call to <code>vector&lt;int&gt;::change\_size(int*&amp;, size\_t&amp;, int&amp;)' size.hpp:30: note: candidates are: void size&lt;T&gt;::change_size(T&amp;, int, int) \[with T = int\] size.hpp: In member function</code>void size&lt;T&gt;::change_size(T&amp;, int, int) [with T = int]':<br />
vector.hpp:75: instantiated from <code>void vector&lt;T&gt;::grow(int) \[with T = int\]' set.hpp:63: instantiated from</code>void set&lt;T&gt;::insert(const T&amp;) [with T = int]'<br />
main.cpp:13: instantiated from here<br />
size.hpp:34: error: invalid types <code>int\[int\]' for array subscript size.hpp:36: error: type \</code>int' argument given to `delete', expected pointer<br />
size.hpp:37: warning: converting to non-pointer type <code>int' from NULL size.hpp:38: error: invalid conversion from \</code>int*' to `int'<br />
size.hpp:41: error: invalid types `int[int]' for array subscript<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
11 errors, 1 warnings</p>
</blockquote>
<p>Großes Dankeschön schon mal im Voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/178524/telefonbuchprogramm</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 22:09:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/178524.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Apr 2007 23:31:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Telefonbuchprogramm on Wed, 11 Apr 2007 23:31:08 GMT]]></title><description><![CDATA[<p>So ich mach grad das Projekt aus dem Volkard Tutorial durch (Telefonbuchprogramm). Eigentlich funktioniert alles, aber ab dem Moment, wenn ich dem vector (selber gebastelt NUR ZUR ÜBUNG!!!)einen Wert zuweisen möchte dann klappt es nicht mehr und es kommen ganz viele Errors.<br />
Ich glaub das liegt irgendwie an meinen &quot;templats&quot; und besonders mit dem &quot;template&quot; von der Klasse &quot;size&quot;. Und es könnte vll. auch an der Vererbung liegen, die Klasse vector erbt die Methoden von der Klasse size. Is das noch ganz koscher? Oder war des nä blöde Idee?<br />
So gesehen sind die ja auch nicht miteinander verwandt, aber es gibt ja auch abstrakte Datentypen, also kann man das auch vererben??<br />
Also irgendwie blick ich des net. Ich glaub da is sicher n Fehler mit dem template von der Klasse size bei dem übergang mit der vererbung... aber so genau weiß ichs irgendwie odch nicht!?<br />
Hier einfach mal der Code+Erros wahrschenilich bin ich einfach schon zu müde <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Wer noch wach ist und Lust hat --&gt; HAU REIN <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>main.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;vector.hpp&quot;
#include &quot;set.hpp&quot;
using namespace std;

int main()
{
	cout &lt;&lt; &quot;   MEN\x9a \n&quot;;
	cout &lt;&lt; &quot;''''''''''''''''''\n\n&quot;;
	cout &lt;&lt; &quot;[1] Name Suchen\n&quot;;
	cout &lt;&lt; &quot;[2] Neuer Name\n&quot;;
	set&lt;int&gt; data_base;
	data_base.insert(55); //&lt;-- ohne die Zeile geht alles ohne Errors oder Warnungen

	return 0;
}
</code></pre>
<p>vector.hpp</p>
<pre><code class="language-cpp">#ifndef VECTOR_HPP_INCLUDED
#define VECTOR_HPP_INCLUDED

#include &quot;size.hpp&quot;

template &lt;class T&gt;
class vector : public size&lt;T&gt;
{
    public:
    vector(int size);
    vector(const vector &amp;rhs);
    ~vector();
    int GetSize() {return m_size;}
    T &amp;operator[] (int index);
    vector &amp;operator= (const vector &amp;rhs);
    void grow(int fields);
    void moveDown(int pos); //ohne Nullstelle!!!
    private:
    T *m_data;
    size_t m_size;
};

template &lt;class T&gt;
vector&lt;T&gt;::vector(int size)
:m_size(size)
{
    m_data=new T[m_size];
}

template &lt;class T&gt;
vector&lt;T&gt;::vector(const vector &amp;rhs)
:m_size(rhs.m_size)
{
    m_data=new T[m_size];
    for (int i=0;i&lt;m_size;i++)
    {
        m_data[i]=rhs.m_data[i];
    }
}

template &lt;class T&gt;
vector&lt;T&gt;::~vector()
{
    delete []m_data;
}

template &lt;class T&gt;
T &amp;vector&lt;T&gt;::operator[] (int index)
{
    return m_data[index];
}

template &lt;class T&gt;
vector&lt;T&gt; &amp;vector&lt;T&gt;::operator= (const vector &amp;rhs)
{
    if (&amp;rhs!=this)
    {
        delete []m_data;
        m_data=NULL;
        m_size=rhs.m_size;
        m_data=new T[m_size];
        for (int i=0;i&lt;m_size;i++)
        {
            m_data[i]=rhs.m_data[i];
        }
    }
    return *this;
}

template &lt;class T&gt;
void vector&lt;T&gt;::grow(int fields)
{
    change_size(m_data,m_size,fields);
}

template &lt;class T&gt;
void vector&lt;T&gt;::moveDown(int pos)
{
    for (int i=pos-1;i&lt;m_size;i++)
    {
        m_data[i]=m_data[i+1];
    }
    m_size--;
}

#endif // VECTOR_HPP_INCLUDED
</code></pre>
<p>size.hpp</p>
<pre><code class="language-cpp">#ifndef SIZE_HPP_INCLUDED
#define SIZE_HPP_INCLUDED

#include &lt;iostream&gt;
#include &lt;string&gt;

template &lt;class T&gt;
class size
{
    public:
    size();
    virtual ~size();
    void change_size(T &amp;array,int length_old,int extension);
};

template &lt;class T&gt;
size&lt;T&gt;::size()
{

}

template &lt;class T&gt;
size&lt;T&gt;::~size()
{

}

template &lt;class T&gt;
void size&lt;T&gt;::change_size(T &amp;array,int length_old,int extension)
{
    T *cache=new T[length_old];
    for (int i=0;i&lt;length_old;i++)
    {
        cache[i]=array[i];
    }
    delete []array;
    array=NULL;
    array=new T[length_old+extension];
    for (int i=0;i&lt;(length_old+extension);i++)
    {
        array[i]=cache[i];
    }
    delete []cache;
}

#endif // SIZE_HPP_INCLUDED
</code></pre>
<p>set.hpp</p>
<pre><code class="language-cpp">#ifndef SET_HPP_INCLUDED
#define SET_HPP_INCLUDED

#include &quot;vector.hpp&quot;

template &lt;class T&gt;
class set
{
    public:
    set();
    ~set();
    T *find(const T &amp;toFind);
    bool has(const T &amp;toFind);
    void insert(const T &amp;toInsert);
    void remove(const T &amp;toRemove);

    private:
    int findIndex(const T &amp;toFind);
    vector&lt;T&gt; m_data;
    int m_size;
};

template &lt;class T&gt;
set&lt;T&gt;::set()
:m_data(10)
{
    m_size=10;
}

template &lt;class T&gt;
set&lt;T&gt;::~set()
{

}

template &lt;class T&gt;
T *set&lt;T&gt;::find(const T &amp;toFind)
{
    int found=findIndex(toFind);
    if (found!=-1)
    {
        return &amp;m_data[found];
    }
    else
    {
        return 0;
    }
}

template &lt;class T&gt;
bool set&lt;T&gt;::has(const T &amp;toFind)
{
    return find(toFind)!=0;
}

template &lt;class T&gt;
void set&lt;T&gt;::insert(const T &amp;toInsert)
{
    if (!has(toInsert))
    {
        if (m_size==m_data.GetSize())
        {
            m_data.grow(10);
        }
        m_data[m_size]=toInsert;
        m_size++;
    }
}

template &lt;class T&gt;
int set&lt;T&gt;::findIndex(const T &amp;toFind)
{
    for (int i=0;i&lt;m_size;i++)
    {
        if (toFind==m_data[i])
        {
            return i;
        }
    }
    return -1;
}

template &lt;class T&gt;
void set&lt;T&gt;::remove(const T &amp;toRemove)
{
    int found=findIndex(toRemove);
    if (found!=-1)
    {
        m_data.moveDown(found);
    }
}

#endif // SET_HPP_INCLUDED
</code></pre>
<p>ERRORS:</p>
<blockquote>
<p>-------------- Build: Debug in Telefonbuch ---------------<br />
Compiling: main.cpp<br />
vector.hpp: In member function <code>void vector&lt;T&gt;::grow(int) \[with T = int\]': set.hpp:63: instantiated from</code>void set&lt;T&gt;::insert(const T&amp;) [with T = int]'<br />
main.cpp:13: instantiated from here<br />
vector.hpp:75: error: no matching function for call to <code>vector&lt;int&gt;::change\_size(int*&amp;, size\_t&amp;, int&amp;)' size.hpp:30: note: candidates are: void size&lt;T&gt;::change_size(T&amp;, int, int) \[with T = int\] size.hpp: In member function</code>void size&lt;T&gt;::change_size(T&amp;, int, int) [with T = int]':<br />
vector.hpp:75: instantiated from <code>void vector&lt;T&gt;::grow(int) \[with T = int\]' set.hpp:63: instantiated from</code>void set&lt;T&gt;::insert(const T&amp;) [with T = int]'<br />
main.cpp:13: instantiated from here<br />
size.hpp:34: error: invalid types <code>int\[int\]' for array subscript size.hpp:36: error: type \</code>int' argument given to `delete', expected pointer<br />
size.hpp:37: warning: converting to non-pointer type <code>int' from NULL size.hpp:38: error: invalid conversion from \</code>int*' to `int'<br />
size.hpp:41: error: invalid types `int[int]' for array subscript<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
11 errors, 1 warnings</p>
</blockquote>
<p>Großes Dankeschön schon mal im Voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264271</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Wed, 11 Apr 2007 23:31:08 GMT</pubDate></item><item><title><![CDATA[Reply to Telefonbuchprogramm on Wed, 11 Apr 2007 23:42:01 GMT]]></title><description><![CDATA[<p>mir scheint, change_size(T &amp;array,... sollte change_size(T *array,... heißen in size.hpp.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264275</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264275</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Wed, 11 Apr 2007 23:42:01 GMT</pubDate></item><item><title><![CDATA[Reply to Telefonbuchprogramm on Thu, 12 Apr 2007 00:15:37 GMT]]></title><description><![CDATA[<p>Ah Hallöchen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
Dann müsste das Argument &quot;array&quot; aber ein Doppelzeiger sein oder? Also &quot;T **array&quot;.<br />
Ich hab die Methode &quot;change_size&quot; jetzt mal umgeschrieben, meiner Meinung nach müsste die dann jetzt so heißen.</p>
<pre><code class="language-cpp">template &lt;class T&gt;
void size&lt;T&gt;::change_size(T **array,int length_old,int extension)
{
    T *cache=new T[length_old];
    for (int i=0;i&lt;length_old;i++)
    {
        cache[i]=(*array)[i];
    }
    delete [](*array);
    *array=0;
    *array=new T[length_old+extension];
    for (int i=0;i&lt;length_old;i++)
    {
        (*array)[i]=cache[i];
    }
    delete []cache;
}
</code></pre>
<p>Es kommen jetzt auch nur noch 4 Errors:</p>
<blockquote>
<p>-------------- Build: Debug in Telefonbuch ---------------<br />
Compiling: main.cpp<br />
vector.hpp: In member function <code>void vector&lt;T&gt;::grow(int) \[with T = int\]': set.hpp:63: instantiated from</code>void set&lt;T&gt;::insert(const T&amp;) [with T = int]'<br />
main.cpp:13: instantiated from here<br />
vector.hpp:75: error: no matching function for call to `vector&lt;int&gt;::change_size(int*&amp;, size_t&amp;, int&amp;)'<br />
size.hpp:30: note: candidates are: void size&lt;T&gt;::change_size(T**, int, int) [with T = int]<br />
Process terminated with status 1 (0 minutes, 0 seconds)<br />
4 errors, 0 warnings</p>
</blockquote>
<p>Nur bringen mich die Erros leider nicht weiter.<br />
Dankeschön schon mal im Voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264282</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Thu, 12 Apr 2007 00:15:37 GMT</pubDate></item><item><title><![CDATA[Reply to Telefonbuchprogramm on Thu, 12 Apr 2007 00:33:53 GMT]]></title><description><![CDATA[<p>nö, nur T* array.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264285</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 12 Apr 2007 00:33:53 GMT</pubDate></item><item><title><![CDATA[Reply to Telefonbuchprogramm on Thu, 12 Apr 2007 00:48:23 GMT]]></title><description><![CDATA[<p>Mh verstehe ich net, warum nur &quot;T *array&quot;??? Dann hab ich ja nur Zugriff auf den Inhalt von array??? und mit &quot;T **array&quot; hätte ich doch Zugriff über den Zeiger, wie sollte ich den da das reservierte Zeuge deleten wenn es heißen würde &quot;T *array&quot;? Oder?<br />
Aber ich hab jetzt auch meinen Fehler entdeckt, ich muss bei &quot;T **array&quot; als Argument auch die Afress von dem Zeiger übergeben. Also muss die Stelle hier (vector.hpp\Zeile 75):<br />
Nicht so heißen --&gt;</p>
<pre><code class="language-cpp">change_size(m_data,m_size,fields);
</code></pre>
<p>sondern so --&gt;</p>
<pre><code class="language-cpp">change_size(&amp;m_data,m_size,fields);
</code></pre>
<p>Verbesserungen und Tipps wären aber trotzdem noch erwünscht. (das is ja noch lang nicht fertig is ja nur das Gründgerüst bis jetzt)</p>
<p>Dankeschön schon mal im Voraus.</p>
<p>PS: Is echt n äußerst gutes Tutorial <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264287</guid><dc:creator><![CDATA[Stromberg]]></dc:creator><pubDate>Thu, 12 Apr 2007 00:48:23 GMT</pubDate></item><item><title><![CDATA[Reply to Telefonbuchprogramm on Thu, 12 Apr 2007 00:49:53 GMT]]></title><description><![CDATA[<p>und bei<br />
for (int i=0;i&lt;(length_old+extension);i++)<br />
{<br />
array[i]=cache[i];<br />
}<br />
haste noch nen abstorz. das feld namens cache ist gar nicht so groß, daß du bis da hinten lesen dürftest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264288</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 12 Apr 2007 00:49:53 GMT</pubDate></item><item><title><![CDATA[Reply to Telefonbuchprogramm on Thu, 12 Apr 2007 00:53:02 GMT]]></title><description><![CDATA[<p>Stromberg schrieb:</p>
<blockquote>
<p>Mh verstehe ich net, warum nur &quot;T *array&quot;??? Dann hab ich ja nur Zugriff auf den Inhalt von array??? und mit &quot;T **array&quot; hätte ich doch Zugriff über den Zeiger, wie sollte ich den da das reservierte Zeuge deleten wenn es heißen würde &quot;T *array&quot;? Oder?</p>
</blockquote>
<p>jo, das haste recht.</p>
<blockquote>
<p>Aber ich hab jetzt auch meinen Fehler entdeckt, ich muss bei &quot;T **array&quot; als Argument auch die Afress von dem Zeiger übergeben. Also muss die Stelle hier (vector.hpp\Zeile 75):<br />
Nicht so heißen --&gt;</p>
<pre><code class="language-cpp">change_size(m_data,m_size,fields);
</code></pre>
<p>sondern so --&gt;</p>
<pre><code class="language-cpp">change_size(&amp;m_data,m_size,fields);
</code></pre>
</blockquote>
<p>stimmt.</p>
<p>dann müßte uch<br />
void size&lt;T&gt;::change_size(T <em>&amp;array,int length_old,int extension)<br />
klappen (mit dem alten aufruf). also array ist eine referenz auf einen zteiger auf T. sieht aber nicht so hübsch in meinen augen aus wie T</em>*.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1264289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1264289</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 12 Apr 2007 00:53:02 GMT</pubDate></item></channel></rss>