<?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[Wie Konstruktor bauen - brauche Pointer]]></title><description><![CDATA[<p>Hallo ich mache bisher alles so:</p>
<pre><code class="language-cpp">template &lt;class T&gt; 	void
Matrix&lt;T&gt;::Init_Matrix(Matrix&lt;T&gt; *A)
{
	A-&gt;irgendwas = ...
        ....
}

template &lt;class T&gt; 	Matrix&lt;T&gt;* 	
Matrix&lt;T&gt;::New_Matrix()
{
	Matrix&lt;T&gt; *A = new Matrix&lt;T&gt;();
	Init_Matrix(A);

	return A;
}

//in der main z.B:

Matrix&lt;double&gt; *my_matrix;
//Mache was mit my_matrix.
</code></pre>
<p>So arbeite ich doch nur mit einem pointer oder?</p>
<p>Ist das unsauber? Sollte ich eher mit Konstruktoren arbeiten?<br />
Wenn ja, warum und wäre es genauso schnell wenn ich statt wie bisher nur einen pointer an methoden übergebe einfach dann das objekt übergebe?<br />
Wie sollte ich es machen?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192910/wie-konstruktor-bauen-brauche-pointer</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 18:20:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192910.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Sep 2007 21:27:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Wed, 19 Sep 2007 21:27:33 GMT]]></title><description><![CDATA[<p>Hallo ich mache bisher alles so:</p>
<pre><code class="language-cpp">template &lt;class T&gt; 	void
Matrix&lt;T&gt;::Init_Matrix(Matrix&lt;T&gt; *A)
{
	A-&gt;irgendwas = ...
        ....
}

template &lt;class T&gt; 	Matrix&lt;T&gt;* 	
Matrix&lt;T&gt;::New_Matrix()
{
	Matrix&lt;T&gt; *A = new Matrix&lt;T&gt;();
	Init_Matrix(A);

	return A;
}

//in der main z.B:

Matrix&lt;double&gt; *my_matrix;
//Mache was mit my_matrix.
</code></pre>
<p>So arbeite ich doch nur mit einem pointer oder?</p>
<p>Ist das unsauber? Sollte ich eher mit Konstruktoren arbeiten?<br />
Wenn ja, warum und wäre es genauso schnell wenn ich statt wie bisher nur einen pointer an methoden übergebe einfach dann das objekt übergebe?<br />
Wie sollte ich es machen?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1368888</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1368888</guid><dc:creator><![CDATA[gandulf]]></dc:creator><pubDate>Wed, 19 Sep 2007 21:27:33 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Wed, 19 Sep 2007 21:29:08 GMT]]></title><description><![CDATA[<p>arg....natürlich initialisiere ich my_matrix so:</p>
<pre><code class="language-cpp">Matrix&lt;double&gt; o_matrix;

my_matrix = o_matrix.New_Matrix();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1368890</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1368890</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Wed, 19 Sep 2007 21:29:08 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Wed, 19 Sep 2007 21:32:18 GMT]]></title><description><![CDATA[<p>kann man schon so machen. die frage ist nur, warum machst du das so? gibs dafür nen guten grund?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1368893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1368893</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Wed, 19 Sep 2007 21:32:18 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Wed, 19 Sep 2007 22:02:29 GMT]]></title><description><![CDATA[<p>hmm....eigentlich weniger - wäre es evtl. schneller an methoden nur eben so einen pointer zu übergeben als sonst ein objekt? Ich weiß leider nicht wie intern ein objekt so angelegt wird. Ansonsten hat es keinen Grund.<br />
Oder wäre das anlegen des Objektes von der Zeit her langsamer?</p>
<p>Sauberes C++ ist es wohl nicht oder? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1368905</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1368905</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Wed, 19 Sep 2007 22:02:29 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 05:32:30 GMT]]></title><description><![CDATA[<p>um misverständnissen vorzubeugen: du verwendest sehr wohl einen konstruktor.</p>
<pre><code class="language-cpp">Matrix&lt;T&gt; *A = new Matrix&lt;T&gt;(); // hier
Matrix&lt;double&gt; o_matrix; // und auch hier
</code></pre>
<p>und was du da machst ist schon sauber. guck dir z.b. mal das pattern hier an <a href="http://de.wikipedia.org/wiki/Fabrikmethode" rel="nofollow">http://de.wikipedia.org/wiki/Fabrikmethode</a></p>
<p>sich ein objekt auf dem stack zu erzeugen und das objekt dann zu verwenden, um objekte desselben typs auf dem heap anzulegen (pointer) ist allerdings tatsächlich ungewöhnlich ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1368932</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1368932</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Thu, 20 Sep 2007 05:32:30 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 08:59:13 GMT]]></title><description><![CDATA[<p>Was soll das ganze denn werden? Du legst dir erst eine Dummy-Matrix an, die dann die &quot;echte&quot; Matrix initialisieren soll. Pack lieber den gesamten Quelltext aus der Init_Matrix() in den Klassenkonstruktor, das ist einfacher zu handhaben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369022</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369022</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 20 Sep 2007 08:59:13 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 11:59:12 GMT]]></title><description><![CDATA[<p>Danke euch,</p>
<p>leider stehe ich irgendwie auf dem Schlauch momentan. Ich versuche es so,<br />
aber so wid doch A uninitialisiert verwendet.</p>
<pre><code class="language-cpp">template&lt;class T&gt;  Matrix&lt;T&gt;::Matrix(Matrix&lt;T&gt;* A)
{
	A-&gt;num_procs = 1;
	A-&gt;my_id = 0;
	A-&gt;my_nbr_cols = 0;
	A-&gt;my_start_index = 0;
	A-&gt;n = 0;
	A-&gt;all_nbr_cols = NULL;
	A-&gt;start_indices = NULL;
	A-&gt;my_nnz = 0;
	A-&gt;pe = NULL;
	A-&gt;symmetric = false;
}

template &lt;class T&gt; 	Matrix&lt;T&gt;* 	
Matrix&lt;T&gt;::New_Matrix()
{
	Matrix&lt;T&gt; *A = new Matrix&lt;T&gt;(A);
// 	Init_Matrix(A);

	return A;
}
</code></pre>
<p>Wenn ich es so mache muss ihc ja wieder ein Objekt auf dem stack anlegen um dann ein Objekt auf dem Heap zu alloziieren:</p>
<pre><code class="language-cpp">emplate&lt;class T&gt;  Matrix&lt;T&gt;::Matrix()
{
	num_procs = 1;
	my_id = 0;
	my_nbr_cols = 0;
	my_start_index = 0;
	n = 0;
	all_nbr_cols = NULL;
	start_indices = NULL;
	my_nnz = 0;
	pe = NULL;
	symmetric = false;
}

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

}

template &lt;class T&gt; 	Matrix&lt;T&gt;* 	
Matrix&lt;T&gt;::New_Matrix()
{
	Matrix&lt;T&gt; *A = new Matrix&lt;T&gt;();
// 	Init_Matrix(A);

	return A;
}

//Aufruf
Matrix&lt;double&gt;* A = New_Matrix() //geht nicht
Matrix&lt;double&gt;* A = o_matrix.New_Matrix() //geht
</code></pre>
<p>Könnt ihr mir vielleicht einen Anstoß geben?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369217</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 11:59:12 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:03:57 GMT]]></title><description><![CDATA[<p>Wozu brauchst du überhaupt die New_Matrix()-Methode? Du hast doch den Matrix-Ctor, der alles nötige erledigt:</p>
<pre><code class="language-cpp">Matrix&lt;double&gt;* A = new Matrix&lt;double&gt;();
</code></pre>
<p>(btw, was spricht dagegen, die Matrix auf den Stack zu packen?)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369223</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:03:57 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:25:08 GMT]]></title><description><![CDATA[<p>Ah ok,</p>
<p>dann hätte ich aber noch eine Frage.<br />
Wenn ich eine Methode aufrufen will die in einer Klasse ist, dazu muss ich dann aber schon immer ein Objekt auf dem stack anlegen oder?</p>
<p>also so:</p>
<pre><code class="language-cpp">Matrix&lt;T&gt;::print()
{
      //irgendwas
}

//beim aurufen:
Matrix&lt;double&gt; o_matrix;

o_matrix.print();
</code></pre>
<p>Ist das so in Ordnung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369249</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:25:08 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:32:12 GMT]]></title><description><![CDATA[<p>Wenn du eine Methode aufrufen willst, brauchst du ein Objekt, auf das du dich beziehen kannst - wo das liegt, ist egal:</p>
<pre><code class="language-cpp">//Objekt auf dem Stack:
Matrix o;
o.print();

//Objekt auf dem Heap:
Matrix* p = new Matrix;
p-&gt;print();
</code></pre>
<p>Ausnahme sind statische Methoden (in der Klassendefinition als 'static typ func(...);' angegeben), die kannst du auch ohne ein zugehöriges Objekt per &quot;Matrix::create();&quot; aufrufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369255</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:32:12 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:42:09 GMT]]></title><description><![CDATA[<p>Danke,</p>
<p>jetzt bekomme ich aber einen haufe an segfaults.<br />
Folgender Code:</p>
<pre><code class="language-cpp">Index_Set::Index_Set()
{

}

Index_Set::Index_Set(int len)
{
	idcs = NULL;
	len = len;
	idcs = new int[len];
}

Index_Set::~Index_Set()
{

}

//Index_Set.h
		///Ctor
		Index_Set();
		Index_Set(int len);

		///Dtor
		~Index_Set();

		//Member variables
		///The index set array
    	int 	*idcs; 

		///Lenght of the index set
		int		len;
</code></pre>
<p>wird so benutzt:</p>
<pre><code class="language-cpp">// Extract pattern from pattern matrix  
	// Create the Index Set J
	J_pattern = o_sub.Get_J_Set(P, col);
	// Copy the values into the big working Index_Set J
	memcpy(J-&gt;idcs, J_pattern-&gt;idcs, J_pattern-&gt;len * sizeof(int));
	J-&gt;len = J_pattern-&gt;len;
</code></pre>
<p>und in Get_J_Set(P,col) folgendes</p>
<pre><code class="language-cpp">template &lt;class T&gt; 	Index_Set* 	
Spai_Sub&lt;T&gt;::Get_J_Set(	Pattern	 	*P,
					const int 	col)
{
	Index_Set	*J = NULL;
	J = P-&gt;j_sets[col];	
	return J;
}

das pattern wird so gefüllt:
[cpp]
for( int col = 0; col &lt; n; col++)
	{
		i_set = new Index_Set(1);
		i_set-&gt;idcs[0] = col;
		P-&gt;j_sets[col] = i_set;
	}
</code></pre>
<p>[/cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369266</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:42:09 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:44:19 GMT]]></title><description><![CDATA[<p>achja,<br />
J und J_pattern sind natürlich schon initialisiert vorher:</p>
<pre><code class="language-cpp">Index_Set 	o_is,
 				*J_pattern = NULL,
 				*J = NULL, 
				*I = NULL;

	// J will be filled with the
	// new J values from pattern
	// and will be updated each augmenting 
	// step.
	J = new Index_Set(A-&gt;n);	
       // Extract pattern from pattern matrix  
	// Create the Index Set J
	J_pattern = o_sub.Get_J_Set(P, col);
	// Copy the values into the big working Index_Set J
	memcpy(J-&gt;idcs, J_pattern-&gt;idcs, J_pattern-&gt;len * sizeof(int));
	J-&gt;len = J_pattern-&gt;len;
</code></pre>
<p>und das Pattern hat sowas als Member:</p>
<pre><code class="language-cpp">/// All index sets of each column
    	Index_Set 	**j_sets;

		/// The length of the pattern - always size n of
		/// matrix A
		int 		len;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1369269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369269</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:44:19 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:45:26 GMT]]></title><description><![CDATA[<p>Woher kommt eigentlich P und wie wurde es angelegt?</p>
<p>(btw, hast du früher mal mit Java gearbeitet?)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369270</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:45:26 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:52:52 GMT]]></title><description><![CDATA[<p>Ne hab wenig mit Java gemacht.</p>
<p>P wird so angelegt:</p>
<pre><code class="language-cpp">Pattern::Pattern(int len)
{
	j_sets = NULL;
	len = len;
	j_sets = new Index_Set*[len];	
}

P = new Pattern(n);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1369282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369282</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:52:52 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:56:58 GMT]]></title><description><![CDATA[<p>Es liegt irgendwie am memcpy...ich weiß nicht warum...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369288</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:56:58 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 12:58:34 GMT]]></title><description><![CDATA[<p>Und wo genau kommt der Segfault? (ich würde ja darauf tippen, daß die Größenangaben nicht ganz zusammenpassen)</p>
<p>PS Nur am Rande: In C++ verwendet man Pointer eher selten - wenn machbar, solltest du deine Variablen auf dem Stack unterbringen. Und die Zugriffe auf Membervariablen sollten lieber von der Klasse selbst übernommen werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369291</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 20 Sep 2007 12:58:34 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 13:02:58 GMT]]></title><description><![CDATA[<p>Nene - an den Längen kanns nicht liegen - es hat ja alles funktioniert bis ich jetzt den Konstruktor geändert hatte. An den Längen hab ich nix verändert.</p>
<p>Der segfault kommt genau beim memcpy() und schreit so:</p>
<pre><code>Conditional jump or move depends on uninitialised value(s)
==7389==    at 0x4022E6C: memcpy (mc_replace_strmem.c:406)
==7389==    by 0x804A1CE: Sp&lt;double&gt;::SP_Column(Matrix&lt;double&gt;*, Matrix&lt;double&gt;*&amp;, Pattern*, int, double, int, int) (in /Source_code/Current/bin/sp)
==7389==    by 0x80497D2: main (in /Source_code/Current/bin/sp)
</code></pre>
<p>Hmm....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369294</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369294</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 13:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 13:10:18 GMT]]></title><description><![CDATA[<p>Ich tippe immer noch auf eine Index-Überschreitung oder einen nicht-initialisierten Zeiger.</p>
<p>Vorschlag: Erklär mal, was du überhaupt vorhast. Vielleicht wird der Quelltext dann klarer. (btw, anstelle der nackten Zeiger würde ich lieber mit std::vector&lt;&gt; arbeiten)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369302</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 20 Sep 2007 13:10:18 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 13:20:53 GMT]]></title><description><![CDATA[<p>Ja ich weiß dass es in C++ schöne Templates gibt wie vector oder Set. Aber ich brauche wirklich das hier.</p>
<p>Was ich vorhabe ist eigentlich trivial: Ein array in ein anderes kopieren.</p>
<p>Also ich habe 2 Index_Sets und möchte von dem einen Index_Set-&gt;idcs array die werte in das andere kopieren Index_Set-&gt;idcs.</p>
<p>Das erste wird so initialisiert dass es vom Pattern welches ein array aus Index_Sets hat einfach eine Index_Set extrahiert wird und an J_pattern übergeben wird.<br />
J (also das zweite array wohin kopiert werden soll) wird einfach so initialisiert:</p>
<p>Index_Set* J = new Index_Set(n);</p>
<p>J_pattern wird so gefüllt:</p>
<pre><code class="language-cpp">template &lt;class T&gt;     Index_Set*    
Spai_Sub&lt;T&gt;::Get_J_Set(    Pattern         *P,
                    const int     col)
{
    Index_Set    *J = NULL;
    J = P-&gt;j_sets[col];   
    return J;
}
</code></pre>
<p>Das Pattern füllt seine j_sets so:</p>
<pre><code class="language-cpp">Pattern 	*P = new Pattern(n);

	for( int col = 0; col &lt; n; col++)
	{
		i_set = new Index_Set(1);
		i_set-&gt;idcs[0] = col;
		P-&gt;j_sets[col] = i_set;
	}
</code></pre>
<p>wobei der Konstruktor so aussieht:</p>
<pre><code class="language-cpp">Pattern::Pattern(int len)
{
	j_sets = NULL;
	len = len;
	j_sets = new Index_Set*[len];	
}
</code></pre>
<p>Die Member von Pattern:</p>
<pre><code class="language-cpp">/// All index sets of each column
    	Index_Set 	**j_sets;

		/// The length of the pattern - always size n of
		/// matrix A
		int 		len;
</code></pre>
<p>das ganze wird so aufgerufen:</p>
<pre><code class="language-cpp">Index_Set 	/*o_is,*/
 				*J_pattern = NULL,
 				*J = NULL, 
				*I = NULL;

	J = new Index_Set(A-&gt;n);		

	J_pattern = o_sub.Get_J_Set(P, col);

	// Copy the values into the big working Index_Set J
	memcpy(J-&gt;idcs, J_pattern-&gt;idcs, J_pattern-&gt;len * sizeof(int));
	J-&gt;len = J_pattern-&gt;len;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1369311</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369311</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 13:20:53 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 13:26:57 GMT]]></title><description><![CDATA[<p>Woher kommen denn die Größenangaben n und l?</p>
<p>(und was genau spricht dagegen, vector'en anstelle der dynamischen Arrays zu verwenden?)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369318</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369318</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 20 Sep 2007 13:26:57 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 13:47:40 GMT]]></title><description><![CDATA[<p>das l ist eine eins als &quot;1&quot;.</p>
<p>das n ist gesetzt. Ich habe es gerade ausgeben lassen.</p>
<p>Ich benutze keine std::vectoren aus einem Grund der vielleicht lächerlich erscheint - aber ich arbeite an einem zeitperformanten programm - und ich hatte mit der std-lib schon einige probleme damals gehabt die mein programm unglaublich langsam werden ließen. Ich hatte es damals umgeschrieben auf reine pointer-arithmetik ohne std-lib und es war viel schneller. Der ein oder andere mag jetzt sagen: Jaja-das lag wohl eher an der umschreibung und nicht an der std-lib. Mag sein - aber nochmal will ich mir das nicht antun. Soviel dazu.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369342</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369342</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 13:47:40 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 13:53:14 GMT]]></title><description><![CDATA[<p>ok, es liegt definitiv daran das J_pattern-&gt;len nicht gesetzt ist.<br />
Aber warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369351</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369351</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 13:53:14 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 13:53:57 GMT]]></title><description><![CDATA[<p>Lass dir doch mal J_Pattern-&gt;len und J-&gt;len ausgeben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369352</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 20 Sep 2007 13:53:57 GMT</pubDate></item><item><title><![CDATA[Reply to Wie Konstruktor bauen - brauche Pointer on Thu, 20 Sep 2007 13:56:11 GMT]]></title><description><![CDATA[<p>AAAArgh.</p>
<p>Ja klar, sowas geht ja nicht:</p>
<pre><code class="language-cpp">Index_Set::Index_Set(int len)
{
	idcs = NULL;
	len = len;
	idcs = new int[len];
}
</code></pre>
<p>sondern nur sowas <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>
<pre><code class="language-cpp">Index_Set::Index_Set(int len_a)
{
	idcs = NULL;
	len = len_a;
	idcs = new int[len];
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1369354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369354</guid><dc:creator><![CDATA[gundalf]]></dc:creator><pubDate>Thu, 20 Sep 2007 13:56:11 GMT</pubDate></item></channel></rss>