<?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[Newbie: Problem mit einem Console Prog.]]></title><description><![CDATA[<p>Hallo,<br />
ich bin ein ziemlicher Frischling in Bezug auf C++;<br />
hab früher rel. viel Turbo Pascal programmiert, daher grundlegende Ahnung wie man ein Programm zum laufen bekommt, aber mehr nicht.</p>
<p>zum Problem:</p>
<p>Ich habe ein Programm geschrieben, dass Daten aus einem Textfile einliest und in ein &quot;record&quot; speichert.</p>
<p>Dies ist das entsprechende struct:</p>
<pre><code>struct Datarecord
{
    int index;
    string Headerline;
    short ST_TDM;
    short DX_TDM;
    short IQ_TDM;
    short HT_TDM;
    short Needstime;
    short Risk;
    short Risktable;
    string Get1;
    string Get2;
    string Get3;
    string Get4;
    string Get5;
    string Get6;
    string Get7;
    string Get8;
    string Opens;
    string Closes;
}

Datarecord Pathfile[50];
</code></pre>
<p>Und es soll mit dieser Funktion initialisiert werden</p>
<pre><code>int Clear_Pathrecord_Memory()
{
int ut=0;
while (ut&lt;=50)
{
Pathfile[ut].index=0;
Pathfile[ut].Headerline=&quot;&quot;;
Pathfile[ut].ST_TDM=0;
Pathfile[ut].DX_TDM=0;
Pathfile[ut].IQ_TDM=0;
Pathfile[ut].HT_TDM=0;
Pathfile[ut].Needstime=0;
Pathfile[ut].Risk=0;
Pathfile[ut].Risktable=0;
Pathfile[ut].Get1=&quot;&quot;;
Pathfile[ut].Get2=&quot;&quot;;
Pathfile[ut].Get3=&quot;&quot;;
Pathfile[ut].Get4=&quot;&quot;;
Pathfile[ut].Get5=&quot;&quot;;
Pathfile[ut].Get6=&quot;&quot;;
Pathfile[ut].Get7=&quot;&quot;;
Pathfile[ut].Get8=&quot;&quot;;
Pathfile[ut].Opens=&quot;none&quot;;
Pathfile[ut].Closes=&quot;none&quot;;
ut++;
}
}
</code></pre>
<p>Der compiler (gnu gcc) nimmt den code sang und klanglos an,<br />
aber beim laufen steigt das Programm bei dieser Funktion mit Fehlermeldung aus.</p>
<p>Ich vermute rein instinktiv es handelt sich um ein Speicherproblem verursacht durch meinen Krautundrüben - Code, aber sicher bin ich mir dabei nicht.</p>
<p>Vielleicht habt ihr eine Idee? Ich bin relativ ratlos und in der FAQ nicht fündig geworden.</p>
<p>Der Code des gesamten Programms:<br />
<a href="http://www.servedhot.net/markus/TRANSFER/main.cpp" rel="nofollow">http://www.servedhot.net/markus/TRANSFER/main.cpp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/135624/newbie-problem-mit-einem-console-prog</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 01:10:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/135624.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Feb 2006 13:07:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Newbie: Problem mit einem Console Prog. on Fri, 03 Feb 2006 13:08:40 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich bin ein ziemlicher Frischling in Bezug auf C++;<br />
hab früher rel. viel Turbo Pascal programmiert, daher grundlegende Ahnung wie man ein Programm zum laufen bekommt, aber mehr nicht.</p>
<p>zum Problem:</p>
<p>Ich habe ein Programm geschrieben, dass Daten aus einem Textfile einliest und in ein &quot;record&quot; speichert.</p>
<p>Dies ist das entsprechende struct:</p>
<pre><code>struct Datarecord
{
    int index;
    string Headerline;
    short ST_TDM;
    short DX_TDM;
    short IQ_TDM;
    short HT_TDM;
    short Needstime;
    short Risk;
    short Risktable;
    string Get1;
    string Get2;
    string Get3;
    string Get4;
    string Get5;
    string Get6;
    string Get7;
    string Get8;
    string Opens;
    string Closes;
}

Datarecord Pathfile[50];
</code></pre>
<p>Und es soll mit dieser Funktion initialisiert werden</p>
<pre><code>int Clear_Pathrecord_Memory()
{
int ut=0;
while (ut&lt;=50)
{
Pathfile[ut].index=0;
Pathfile[ut].Headerline=&quot;&quot;;
Pathfile[ut].ST_TDM=0;
Pathfile[ut].DX_TDM=0;
Pathfile[ut].IQ_TDM=0;
Pathfile[ut].HT_TDM=0;
Pathfile[ut].Needstime=0;
Pathfile[ut].Risk=0;
Pathfile[ut].Risktable=0;
Pathfile[ut].Get1=&quot;&quot;;
Pathfile[ut].Get2=&quot;&quot;;
Pathfile[ut].Get3=&quot;&quot;;
Pathfile[ut].Get4=&quot;&quot;;
Pathfile[ut].Get5=&quot;&quot;;
Pathfile[ut].Get6=&quot;&quot;;
Pathfile[ut].Get7=&quot;&quot;;
Pathfile[ut].Get8=&quot;&quot;;
Pathfile[ut].Opens=&quot;none&quot;;
Pathfile[ut].Closes=&quot;none&quot;;
ut++;
}
}
</code></pre>
<p>Der compiler (gnu gcc) nimmt den code sang und klanglos an,<br />
aber beim laufen steigt das Programm bei dieser Funktion mit Fehlermeldung aus.</p>
<p>Ich vermute rein instinktiv es handelt sich um ein Speicherproblem verursacht durch meinen Krautundrüben - Code, aber sicher bin ich mir dabei nicht.</p>
<p>Vielleicht habt ihr eine Idee? Ich bin relativ ratlos und in der FAQ nicht fündig geworden.</p>
<p>Der Code des gesamten Programms:<br />
<a href="http://www.servedhot.net/markus/TRANSFER/main.cpp" rel="nofollow">http://www.servedhot.net/markus/TRANSFER/main.cpp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/984985</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/984985</guid><dc:creator><![CDATA[Tarjan]]></dc:creator><pubDate>Fri, 03 Feb 2006 13:08:40 GMT</pubDate></item><item><title><![CDATA[Reply to Newbie: Problem mit einem Console Prog. on Fri, 03 Feb 2006 13:14:42 GMT]]></title><description><![CDATA[<p>Servus,</p>
<p>jo, Kraut und Rüben Code triffts scho <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>
<p>In C++ werden, im Gegensatz zu Pascal, Arrays mit 0 beginnend indiziert.</p>
<p>Ein Datarecord Pathfile[50]; enthält Elemente von 0 bis 49.</p>
<p>while (ut&lt;=50) spricht aber auch das Pathfile[50] an, und das gibt es ja nicht mehr. Nimm das = also weg.</p>
<p>Ich denke, wenn du dich mit (Default)-Konstruktoren beschäftigst (Auch Structuren können welche haben, wirst du deinen Code übersichtlicher machen können.<br />
Zumal neu erstellte string Objekte immer leer sind.<br />
(Denn die haben ja schon einen Default-Konstruktor, der sie leer initialisiert).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/984990</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/984990</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 03 Feb 2006 13:14:42 GMT</pubDate></item><item><title><![CDATA[Reply to Newbie: Problem mit einem Console Prog. on Fri, 03 Feb 2006 13:19:08 GMT]]></title><description><![CDATA[<p>Ah, das ging schnell.<br />
Ein saudummer Fehler, danke- funktioniert jetzt.</p>
<p>..Und danke auch für den Tip, werd mir das ansehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/984995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/984995</guid><dc:creator><![CDATA[Tarjan]]></dc:creator><pubDate>Fri, 03 Feb 2006 13:19:08 GMT</pubDate></item></channel></rss>