<?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[dynamische matríx]]></title><description><![CDATA[<p>hi,<br />
folgendes programm:<br />
benutzer soll zeilenzahl einer matrix auch char eingeben<br />
eingabe z.b. 5 -&gt; &quot;nullte&quot; zeile des arrays soll ein zeichen lang sein, erste zeile des arrays soll 2 zeichen lang sein, zweite zeile soll drei zeichen lang sein usw. so sieht mein prog aus:</p>
<p>head.h:</p>
<pre><code class="language-cpp">#ifndef head_h
#define head_h head_h

class matrix {
public:
    void matrix_erstellen();
    void matrix_ausgeben();
    void matrix_elementaendern();
private:
    char** pMatrix;
    int zeilenzahl;
};
#endif
</code></pre>
<p>matrix.cpp:</p>
<pre><code class="language-cpp">#include&quot;head.h&quot;
#include&lt;iostream&gt;
#include&lt;cstdlib&gt;
using namespace std;

void matrix::matrix_erstellen() {
    int i,j;
    int zufallszahl;
    cout&lt;&lt;&quot;Wieviele Zeilen soll diei Matrix haben? &quot;;cin&gt;&gt;zeilenzahl;
    zeilenzahl--;
    char** pMatrix = new char*[zeilenzahl];
    for(i=0;i&lt;=zeilenzahl;i++) pMatrix[i] = new char[i+1];
    for (i=0;i&lt;=zeilenzahl;i++) {
        for (j=0;j&lt;=i+1;j++) {
            zufallszahl = 33+(rand() % 93);
            pMatrix [i][j] = static_cast&lt;char&gt;(zufallszahl);
        }
    }
    cout&lt;&lt;&quot;\nMatrix wurde erfolgreich erstellt.\n&quot;;       
}

void matrix::matrix_ausgeben() {
    int i,j;
    cout&lt;&lt;endl;
    for (i=0;i&lt;=zeilenzahl;i++) {
        for (j=0;j&lt;=i+1;j++) {
            cout&lt;&lt; pMatrix[i][j]&lt;&lt;&quot; &quot;;
        }
        cout&lt;&lt;endl;
    }
}

void matrix::matrix_elementaendern() {
    cout&lt;&lt;&quot;kommt spaeter&quot;;
}
</code></pre>
<pre><code class="language-cpp">#include&quot;head.h&quot;
#include&lt;iostream&gt;
using namespace std;

int main() {
    cout&lt;&lt;&quot;Willkommen beim Matrix Programm\n&quot;;
    matrix matrix1;
    matrix1.matrix_erstellen();
    matrix1.matrix_ausgeben();
return 0;
}
</code></pre>
<p>das ganze únter visual c++. beim compilieren hab ich 0 errors 0 warnings und wenn ich dann ausführen will kommt folgendes:<br />
Linking...<br />
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16<br />
Debug/aufgabe4.exe : fatal error LNK1120: 1 unresolved externals<br />
Error executing link.exe.</p>
<p>aufgabe4.exe - 2 error(s), 0 warning(s)</p>
<p>kann mir jemand sagen woran das liegt?<br />
thx onlythelonely</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/5980/dynamische-matríx</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 16:10:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/5980.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Jun 2003 07:26:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dynamische matríx on Mon, 02 Jun 2003 07:26:00 GMT]]></title><description><![CDATA[<p>hi,<br />
folgendes programm:<br />
benutzer soll zeilenzahl einer matrix auch char eingeben<br />
eingabe z.b. 5 -&gt; &quot;nullte&quot; zeile des arrays soll ein zeichen lang sein, erste zeile des arrays soll 2 zeichen lang sein, zweite zeile soll drei zeichen lang sein usw. so sieht mein prog aus:</p>
<p>head.h:</p>
<pre><code class="language-cpp">#ifndef head_h
#define head_h head_h

class matrix {
public:
    void matrix_erstellen();
    void matrix_ausgeben();
    void matrix_elementaendern();
private:
    char** pMatrix;
    int zeilenzahl;
};
#endif
</code></pre>
<p>matrix.cpp:</p>
<pre><code class="language-cpp">#include&quot;head.h&quot;
#include&lt;iostream&gt;
#include&lt;cstdlib&gt;
using namespace std;

void matrix::matrix_erstellen() {
    int i,j;
    int zufallszahl;
    cout&lt;&lt;&quot;Wieviele Zeilen soll diei Matrix haben? &quot;;cin&gt;&gt;zeilenzahl;
    zeilenzahl--;
    char** pMatrix = new char*[zeilenzahl];
    for(i=0;i&lt;=zeilenzahl;i++) pMatrix[i] = new char[i+1];
    for (i=0;i&lt;=zeilenzahl;i++) {
        for (j=0;j&lt;=i+1;j++) {
            zufallszahl = 33+(rand() % 93);
            pMatrix [i][j] = static_cast&lt;char&gt;(zufallszahl);
        }
    }
    cout&lt;&lt;&quot;\nMatrix wurde erfolgreich erstellt.\n&quot;;       
}

void matrix::matrix_ausgeben() {
    int i,j;
    cout&lt;&lt;endl;
    for (i=0;i&lt;=zeilenzahl;i++) {
        for (j=0;j&lt;=i+1;j++) {
            cout&lt;&lt; pMatrix[i][j]&lt;&lt;&quot; &quot;;
        }
        cout&lt;&lt;endl;
    }
}

void matrix::matrix_elementaendern() {
    cout&lt;&lt;&quot;kommt spaeter&quot;;
}
</code></pre>
<pre><code class="language-cpp">#include&quot;head.h&quot;
#include&lt;iostream&gt;
using namespace std;

int main() {
    cout&lt;&lt;&quot;Willkommen beim Matrix Programm\n&quot;;
    matrix matrix1;
    matrix1.matrix_erstellen();
    matrix1.matrix_ausgeben();
return 0;
}
</code></pre>
<p>das ganze únter visual c++. beim compilieren hab ich 0 errors 0 warnings und wenn ich dann ausführen will kommt folgendes:<br />
Linking...<br />
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16<br />
Debug/aufgabe4.exe : fatal error LNK1120: 1 unresolved externals<br />
Error executing link.exe.</p>
<p>aufgabe4.exe - 2 error(s), 0 warning(s)</p>
<p>kann mir jemand sagen woran das liegt?<br />
thx onlythelonely</p>
]]></description><link>https://www.c-plusplus.net/forum/post/29069</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/29069</guid><dc:creator><![CDATA[onlythelonely]]></dc:creator><pubDate>Mon, 02 Jun 2003 07:26:00 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische matríx on Mon, 02 Jun 2003 07:40:00 GMT]]></title><description><![CDATA[<p>Du hast ne win32-anwendung erstellt, schreibst aber ein konsolenprogramm. Du musst als Projekt eine Win32-Konsolenanwendung oder so ähnlich erstellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/29070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/29070</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Mon, 02 Jun 2003 07:40:00 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische matríx on Mon, 02 Jun 2003 07:51:00 GMT]]></title><description><![CDATA[<p>Oder erstell einfach ein Konsolenprojekt neu und mach Copy &amp; Paste</p>
]]></description><link>https://www.c-plusplus.net/forum/post/29071</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/29071</guid><dc:creator><![CDATA[Walli]]></dc:creator><pubDate>Mon, 02 Jun 2003 07:51:00 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische matríx on Mon, 02 Jun 2003 07:56:00 GMT]]></title><description><![CDATA[<p>vielen dank jetzt startet das programm.<br />
jetzt ist nur folgendes problem:<br />
sobald die ausgabe der matrix startet kommt eine windows fehler:<br />
aufgabe4.exe hat ein problem und muss beendet werden...<br />
wenn ich direkt bei der matrixerstellung teste ob werte drin sind funktioniert die ausgabe</p>
<pre><code class="language-cpp">pMatrix [i][j] = static_cast&lt;char&gt;(zufallszahl);cout&lt;&lt;pMatrix[i][j];
</code></pre>
<p>aber sobald die ausgabe methode startet kommt der windows fehler.<br />
hab durch // rumprobiert. muss an der zeile</p>
<pre><code class="language-cpp">cout&lt;&lt;pMatrix[i][j];
</code></pre>
<p>liegen. warum?</p>
<p>onlythelonely</p>
]]></description><link>https://www.c-plusplus.net/forum/post/29072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/29072</guid><dc:creator><![CDATA[onlythelonely]]></dc:creator><pubDate>Mon, 02 Jun 2003 07:56:00 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische matríx on Mon, 02 Jun 2003 12:03:00 GMT]]></title><description><![CDATA[<p>wenn ich die ausgabe schleife in die methode reinkopiere wo die matrix erstellt wird funktioniert sie! aber nicht wenn sie in der ausgabe methode steht. kann doch eigentlich nicht sein oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/29073</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/29073</guid><dc:creator><![CDATA[onlythelonely]]></dc:creator><pubDate>Mon, 02 Jun 2003 12:03:00 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische matríx on Mon, 02 Jun 2003 12:49:00 GMT]]></title><description><![CDATA[<p>Du schreibst über den alloziierten Speicher hinaus. Mach mal anstatt i&lt;=zeilenzahl einfach i&lt;zeilenzahl <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/29074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/29074</guid><dc:creator><![CDATA[Walli]]></dc:creator><pubDate>Mon, 02 Jun 2003 12:49:00 GMT</pubDate></item><item><title><![CDATA[Reply to dynamische matríx on Mon, 02 Jun 2003 12:51:00 GMT]]></title><description><![CDATA[<p>Hat nix mehr mit MFC/VisualC zu tun!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/29075</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/29075</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Mon, 02 Jun 2003 12:51:00 GMT</pubDate></item></channel></rss>