<?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[Stack dynamisch]]></title><description><![CDATA[<p>Hallo zusamen, ich bin neu in C++ und habe noch ein paar Verständnisfragen. Als kleine Aufgabe soll ein Stack dynamisch für Zahlen erstellt werden. Hier mein Ansatz:</p>
<pre><code class="language-cpp">stack.h:

class cStack{

	friend int main(void);
	friend void showStack(cStack *Start);

private:

	int top;
	double number;
	class cStack *next;
	class cStack *Start;

public:

	cStack(void);		//Konstruktor
	bool push(double number);
	double pop(void);
	int count(void);
	void drop(void);
	void swap(void);

	double get(int i);

};

stack.cpp:

#include&quot;stack.h&quot;
#include&lt;iostream&gt;
#include&lt;stdio.h&gt;

#define TRUE 1
#define FALSE 0

cStack::cStack(void)
{
	number=0;

	Start=NULL;
}

bool cStack::push(double number)
{

	int Fehler=0;

	if(!Fehler)
	{
		//next = new cStack;
		Start = (cStack*)malloc(sizeof(cStack));

		if(Start==NULL) Fehler= -1;
	}

	if(!Fehler) (Start)-&gt;number= number;

	Start = Start-&gt;next;

	return true;

}

double cStack::pop(void)
{

	return 0;

}

int cStack::count(void)
{

	return 1;
}

void cStack::drop(void)
{

}

void cStack::swap(void)
{

}

double cStack::get(int i)
{

	return 0;

}

Rechner.cpp:

#include&lt;iostream&gt;
#include&quot;stack.h&quot;
using namespace std;

void showStack(cStack *Start);

int main(void)
{
	int rueckgabe;

	cStack Stack;

	rueckgabe = Stack.push(18);

	Stack.push(9);

	//showStack(Stack.Start);

	cout &lt;&lt; &quot;Rueckgabe: &quot; &lt;&lt; rueckgabe &lt;&lt;endl;

	//cout &lt;&lt; &quot;Stack: &quot; &lt;&lt; Stack.Start-&gt;number &lt;&lt;endl;
        //hier habe ich versucht die erste Zahl auszugeben.

	system(&quot;PAUSE&quot;);

	return 0;

}
//Diese Funktion soll für die Ausgabe dienen, aber ich bekomme immer eine Fehlermeldung und rufe sie in main nicht auf ;)
void showStack (cStack *Start)
{
	while(Start){

		cout &lt;&lt; &quot;Stack: &quot; &lt;&lt; Start-&gt;number &lt;&lt; endl;
		Start = Start-&gt;next;
	}

}
</code></pre>
<p>Ich habe Probleme den Stack auszugeben. Das Programm steht noch in den Grundzügen, somit sind noch nicht alle Methoden implementiert und das Error-Handling ist auch noch nicht fertig. Ich wäre sehr dankbar für eine Antwort <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/304482/stack-dynamisch</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 11:06:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/304482.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Jun 2012 11:18:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 11:18:09 GMT]]></title><description><![CDATA[<p>Hallo zusamen, ich bin neu in C++ und habe noch ein paar Verständnisfragen. Als kleine Aufgabe soll ein Stack dynamisch für Zahlen erstellt werden. Hier mein Ansatz:</p>
<pre><code class="language-cpp">stack.h:

class cStack{

	friend int main(void);
	friend void showStack(cStack *Start);

private:

	int top;
	double number;
	class cStack *next;
	class cStack *Start;

public:

	cStack(void);		//Konstruktor
	bool push(double number);
	double pop(void);
	int count(void);
	void drop(void);
	void swap(void);

	double get(int i);

};

stack.cpp:

#include&quot;stack.h&quot;
#include&lt;iostream&gt;
#include&lt;stdio.h&gt;

#define TRUE 1
#define FALSE 0

cStack::cStack(void)
{
	number=0;

	Start=NULL;
}

bool cStack::push(double number)
{

	int Fehler=0;

	if(!Fehler)
	{
		//next = new cStack;
		Start = (cStack*)malloc(sizeof(cStack));

		if(Start==NULL) Fehler= -1;
	}

	if(!Fehler) (Start)-&gt;number= number;

	Start = Start-&gt;next;

	return true;

}

double cStack::pop(void)
{

	return 0;

}

int cStack::count(void)
{

	return 1;
}

void cStack::drop(void)
{

}

void cStack::swap(void)
{

}

double cStack::get(int i)
{

	return 0;

}

Rechner.cpp:

#include&lt;iostream&gt;
#include&quot;stack.h&quot;
using namespace std;

void showStack(cStack *Start);

int main(void)
{
	int rueckgabe;

	cStack Stack;

	rueckgabe = Stack.push(18);

	Stack.push(9);

	//showStack(Stack.Start);

	cout &lt;&lt; &quot;Rueckgabe: &quot; &lt;&lt; rueckgabe &lt;&lt;endl;

	//cout &lt;&lt; &quot;Stack: &quot; &lt;&lt; Stack.Start-&gt;number &lt;&lt;endl;
        //hier habe ich versucht die erste Zahl auszugeben.

	system(&quot;PAUSE&quot;);

	return 0;

}
//Diese Funktion soll für die Ausgabe dienen, aber ich bekomme immer eine Fehlermeldung und rufe sie in main nicht auf ;)
void showStack (cStack *Start)
{
	while(Start){

		cout &lt;&lt; &quot;Stack: &quot; &lt;&lt; Start-&gt;number &lt;&lt; endl;
		Start = Start-&gt;next;
	}

}
</code></pre>
<p>Ich habe Probleme den Stack auszugeben. Das Programm steht noch in den Grundzügen, somit sind noch nicht alle Methoden implementiert und das Error-Handling ist auch noch nicht fertig. Ich wäre sehr dankbar für eine Antwort <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220563</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220563</guid><dc:creator><![CDATA[Stack]]></dc:creator><pubDate>Thu, 07 Jun 2012 11:18:09 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 11:26:23 GMT]]></title><description><![CDATA[<p>Einige Verbesserungsvorschläge:</p>
<p>1. Templates (und falls die Bedingung des Template-Parameters weiterhin gilt (Zahl), dann eine static_assert o. ä.)<br />
2. Ein Stack ist eigentlich ein Adapter (wie auch in der STL), willst du nicht einen Sequentiellen STL-Container o. ä. als Array verwenden?<br />
3.</p>
<pre><code class="language-cpp">#define TRUE 1
#define FALSE 0
</code></pre>
<p>Wieso nicht gleich die Schlüsselwörter?</p>
<p>Und noch weitere...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220567</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220567</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 11:26:23 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 11:33:20 GMT]]></title><description><![CDATA[<p>Also ich habe mit Templates noch nicht gearbeitet und weiß nicht was das ist... bzw. ich habe es gerade mal gegoogelt. Also ich bin gerade am Anfang von C++... Nochmal zu der Aufgabe, es soll eine Verkettete Liste verwendet werden. Die Konstanten hatte ich vergessen rauszunehmen, wusste nicht mehr ob die vor definiert sind.</p>
<p>Vielen Dank erstmal für die Vorschläge! <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220571</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220571</guid><dc:creator><![CDATA[Stack]]></dc:creator><pubDate>Thu, 07 Jun 2012 11:33:20 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 18:57:15 GMT]]></title><description><![CDATA[<p>Stack schrieb:</p>
<blockquote>
<p>Also ich habe mit Templates noch nicht gearbeitet und weiß nicht was das ist... bzw. ich habe es gerade mal gegoogelt. Also ich bin gerade am Anfang von C++... Nochmal zu der Aufgabe, es soll eine Verkettete Liste verwendet werden.</p>
</blockquote>
<p>Denkvorschlag (nichts ernstes):</p>
<pre><code class="language-cpp">template&lt;typename type, typename container = std::deque&lt;type&gt;&gt;
class stack
{
      size_t mSize;
      container mContainer;

public:

      explicit stack(container const&amp; Con = container()):
      mSize(Con.size()),
      mContainer(Con) {}

      void push(type const&amp; e)
      {
            mContainer.push_back(e);
      }

      void pop()
      {
            mContainer.pop_back();
      }

      type&amp; top()
      {
            return mContainer.back();
      }

      type const&amp; top() const
      {
            return mContainer.back();
      }

      bool empty() const {return !size();}
      size_t size() const {return mSize;}

};
</code></pre>
<p>Ein wenig wie der <code>std::stack</code> .<br />
Du kannst wegen der verketten liste ja das machen:</p>
<pre><code class="language-cpp">stack&lt;int, std::list&lt;int&gt;&gt; s;
</code></pre>
<p>Oder gleich als default-parameter ...<br />
Wenn du keine Templates magst, kannst du alle <code>type</code> s durch <code>int</code> und alle <code>container</code> s durch <code>std::list&lt;int&gt;</code> ersetzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220574</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:57:15 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 11:47:09 GMT]]></title><description><![CDATA[<p>Buhh, da muss ich jetzt erstmal schlucken <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="😃"
    /> aber an sich ist deine Idee nicht schlecht... ich muss das jetzt erstmal verarbeiten! Aber vielen Dank <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220576</guid><dc:creator><![CDATA[Stack]]></dc:creator><pubDate>Thu, 07 Jun 2012 11:47:09 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 11:52:30 GMT]]></title><description><![CDATA[<p>Wieso sollte irgendjemand eine deque für einen Stack nehmen? Die höchstens bei einer FIFO-Queue, ein Stack ist aber LIFO.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220579</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220579</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Thu, 07 Jun 2012 11:52:30 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 16:47:42 GMT]]></title><description><![CDATA[<p>Ethon schrieb:</p>
<blockquote>
<p>Wieso sollte irgendjemand eine deque für einen Stack nehmen? Die höchstens bei einer FIFO-Queue, ein Stack ist aber LIFO.</p>
</blockquote>
<p>Deswegen ja nur als Hinweis, dass auch eine <code>deque</code> ihren Zweck erfüllen würde. Da eignet sich aber (wie bereits durch mich angedeutet - oder auch nicht) eine <code>std::list</code> besser.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220652</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 16:47:42 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 17:39:34 GMT]]></title><description><![CDATA[<p>Stack schrieb:</p>
<blockquote>
<pre><code class="language-cpp">Start = (cStack*)malloc(sizeof(cStack));
</code></pre>
</blockquote>
<p>Eieieieiei! Was ist dein Background und wie lernst du C++?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220672</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Thu, 07 Jun 2012 17:39:34 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 18:13:15 GMT]]></title><description><![CDATA[<p>krümelkacker schrieb:</p>
<blockquote>
<p>Stack schrieb:</p>
<blockquote>
<pre><code class="language-cpp">Start = (cStack*)malloc(sizeof(cStack));
</code></pre>
</blockquote>
<p>Eieieieiei! Was ist dein Background und wie lernst du C++?</p>
</blockquote>
<p>Selbst für einen C-Programmierer Beängstigend. Nie den Rückgabewert von <code>malloc</code> casten... <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2220684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220684</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:13:15 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 18:19:46 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p><strong>wobei bemerkt sei das std::deque auch eine verkette Liste ist</strong></p>
</blockquote>
<p>Eieieieiei! Was ist dein Background und wie lernst du die STL?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220686</guid><dc:creator><![CDATA[einhuhn]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:19:46 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 18:55:59 GMT]]></title><description><![CDATA[<p>Edit: gelöscht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220692</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:55:59 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 18:47:56 GMT]]></title><description><![CDATA[<p>deque hat so ziemlich nichts mit verketteten Listen zu tun...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220695</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:47:56 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 18:56:53 GMT]]></title><description><![CDATA[<p>Edit: Ah, stop. Da hab ich wohl den namen falsch verstanden...<br />
Deque wird ja intern durch ein Array dargestellt und ist wie ein <code>std::vector</code> aufgebaut.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220700</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:56:53 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 18:57:44 GMT]]></title><description><![CDATA[<p>Nö.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220704</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:57:44 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 18:58:44 GMT]]></title><description><![CDATA[<p>Kellerautomat schrieb:</p>
<blockquote>
<p>Nö.</p>
</blockquote>
<p>Doch, laut Jürgen Wolf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220705</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220705</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:58:44 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 19:00:58 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220707</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Thu, 07 Jun 2012 19:00:58 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 19:02:43 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>Doch, laut Jürgen Wolf.</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>Quelle: <a href="http://www.cplusplus.com/reference/stl/deque/" rel="nofollow">C++ Reference - dequeu</a></p>
<blockquote>
<p>[...] unlike vectors, deques are not guaranteed to have all its elements in contiguous storage locations, eliminating thus the possibility of safe access through pointer arithmetics.</p>
<p>Both vectors and deques provide thus a very similar interface and can be used for similar purposes, but internally both work in quite different ways: While vectors are very similar to a plain array that grows by reallocating all of its elements in a unique block when its capacity is exhausted, the elements of a deques can be divided in several chunks of storage, with the class keeping all this information and providing a uniform access to the elements.<br />
[...]</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2220708</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220708</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Thu, 07 Jun 2012 19:02:43 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 19:12:38 GMT]]></title><description><![CDATA[<p>Gut, gut. <strong>Jetzt</strong> liegt das Buch im Müll. Mein C++-Wissen ist mir locker nochmal 40€ wert...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220714</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220714</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 19:12:38 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 19:14:49 GMT]]></title><description><![CDATA[<p>Laut Jürgen Wolf erbt eine Wurst auch virtuell vom Supermarkt. <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>gruß<br />
syntax</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220716</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220716</guid><dc:creator><![CDATA[Syntax_error]]></dc:creator><pubDate>Thu, 07 Jun 2012 19:14:49 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Fri, 08 Jun 2012 13:42:26 GMT]]></title><description><![CDATA[<p>Syntax_error schrieb:</p>
<blockquote>
<p>Laut Jürgen Wolf erbt eine Wurst auch virtuell vom Supermarkt. <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>gruß<br />
syntax</p>
</blockquote>
<p>Supermarkt ist eine Wurst und ein Brot.</p>
<p>Der Typ hat sie doch nicht mehr alle, bald kommt</p>
<pre><code class="language-cpp">struct Kind : public F***e, protected Penis
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2220733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220733</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 08 Jun 2012 13:42:26 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 19:42:59 GMT]]></title><description><![CDATA[<p>Und Erwachsene haben keine Geschlechtsorgane?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220734</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Thu, 07 Jun 2012 19:42:59 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Thu, 07 Jun 2012 19:45:21 GMT]]></title><description><![CDATA[<p>Kellerautomat schrieb:</p>
<blockquote>
<p>Und Erwachsene haben keine Geschlechtsorgane?</p>
</blockquote>
<pre><code class="language-cpp">template&lt;typename genetalien&gt;
class Erwachsen : public Burnout, public Finanzkrise, private Beziehungsprobleme, private genetalien
</code></pre>
<p>Übrigens ein interessantes Paradigma, ableiten von template-parametern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220735</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 07 Jun 2012 19:45:21 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Fri, 08 Jun 2012 03:57:14 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>Ethon schrieb:</p>
<blockquote>
<p>Wieso sollte irgendjemand eine deque für einen Stack nehmen? Die höchstens bei einer FIFO-Queue, ein Stack ist aber LIFO.</p>
</blockquote>
<p>Deswegen ja nur als Hinweis, dass auch eine <code>deque</code> ihren Zweck erfüllen würde. Da eignet sich aber (wie bereits durch mich angedeutet - oder auch nicht) eine <code>std::list</code> besser.</p>
</blockquote>
<p>Nö, ein std::vector natürlich.<br />
Der ist ein vollwertiger Stack, er stellt push_back, pop_back und empty bereit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220880</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220880</guid><dc:creator><![CDATA[Ethon_]]></dc:creator><pubDate>Fri, 08 Jun 2012 03:57:14 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Fri, 08 Jun 2012 06:45:26 GMT]]></title><description><![CDATA[<p>Ethon_ schrieb:</p>
<blockquote>
<p>Nö, ein std::vector natürlich.<br />
Der ist ein vollwertiger Stack, er stellt push_back, pop_back und empty bereit.</p>
</blockquote>
<p>Warum? Da werden die Elemente umkopiert, nur damit du einen zusammenhängenden Speicherbereich hast. Das braucht ein Stack nicht.</p>
<p>Die <code>std::deque</code> ist da schon richtig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220895</guid><dc:creator><![CDATA[einhuhn]]></dc:creator><pubDate>Fri, 08 Jun 2012 06:45:26 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Fri, 08 Jun 2012 06:58:25 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<pre><code class="language-cpp">struct Kind : public F****, protected Penis
</code></pre>
</blockquote>
<p>wenn es hier irgendwo einen &quot;Melden&quot;-Button gäbe, hätte ich ihn jetzt gedrückt. Oder bin ich nur zu blind, diesen zu finden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220900</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Fri, 08 Jun 2012 06:58:25 GMT</pubDate></item><item><title><![CDATA[Reply to Stack dynamisch on Fri, 08 Jun 2012 13:41:59 GMT]]></title><description><![CDATA[<p>daddy_felix schrieb:</p>
<blockquote>
<p>Hacker schrieb:</p>
<blockquote>
<pre><code class="language-cpp">struct Kind : public F****, protected Penis
</code></pre>
</blockquote>
<p>wenn es hier irgendwo einen &quot;Melden&quot;-Button gäbe, hätte ich ihn jetzt gedrückt. Oder bin ich nur zu blind, diesen zu finden?</p>
</blockquote>
<p>Der Melde-Button ist die Klingel von Jürgen Wolf.<br />
Editiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2221000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2221000</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 08 Jun 2012 13:41:59 GMT</pubDate></item></channel></rss>