<?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[Variablen für Speicherort bei ifstream]]></title><description><![CDATA[<p>Wie kann ich mit 2 Variablen (Datum und Uhrzeit)abfragen lassen und diese dann mit dem Speichertort (c:\\windows\\dokummente und einstellungen\\desktop\) in ifstream einbinden??</p>
<pre><code class="language-csharp">cout&lt;&lt;&quot;Geben Sie Bitte ein Datum ein z.B. 010109 &quot;&lt;&lt;endl;
cin&gt;&gt; Datum;

cout&lt;&lt;&quot;Geben Sie Bitte die Uhrzeit ein z.B. 125959 &quot;&lt;&lt;endl;
cin&gt;&gt; Uhrzeit;

ifstream Eingabedatei(&quot;c:\\Dokumente und Einstellungen\\Administrator\\Desktop\\Datum + Uhrzeit &lt;&lt;&quot;); // ????? wie einfügen
</code></pre>
<p>es sollte mit ifstream realisiert werden<br />
kann mir jemand helfen, vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/235010/variablen-für-speicherort-bei-ifstream</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 15:48:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/235010.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Feb 2009 16:09:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 16:21:35 GMT]]></title><description><![CDATA[<p>Wie kann ich mit 2 Variablen (Datum und Uhrzeit)abfragen lassen und diese dann mit dem Speichertort (c:\\windows\\dokummente und einstellungen\\desktop\) in ifstream einbinden??</p>
<pre><code class="language-csharp">cout&lt;&lt;&quot;Geben Sie Bitte ein Datum ein z.B. 010109 &quot;&lt;&lt;endl;
cin&gt;&gt; Datum;

cout&lt;&lt;&quot;Geben Sie Bitte die Uhrzeit ein z.B. 125959 &quot;&lt;&lt;endl;
cin&gt;&gt; Uhrzeit;

ifstream Eingabedatei(&quot;c:\\Dokumente und Einstellungen\\Administrator\\Desktop\\Datum + Uhrzeit &lt;&lt;&quot;); // ????? wie einfügen
</code></pre>
<p>es sollte mit ifstream realisiert werden<br />
kann mir jemand helfen, vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669467</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669467</guid><dc:creator><![CDATA[1Aiden]]></dc:creator><pubDate>Tue, 24 Feb 2009 16:21:35 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 17:14:15 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">cout&lt;&lt;&quot;Geben Sie Bitte ein Datum ein z.B. 010109 &quot;&lt;&lt;endl;
cin&gt;&gt; Datum;

cout&lt;&lt;&quot;Geben Sie Bitte die Uhrzeit ein z.B. 125959 &quot;&lt;&lt;endl;
cin&gt;&gt; Uhrzeit;

ifstream Eingabedatei(&quot;c:/Dokumente und Einstellungen/Administrator/Desktop/Datum + Uhrzeit &lt;&lt;&quot;);

Eingabedatei &lt;&lt; Datum &lt;&lt; &quot; &quot; &lt;&lt; Uhrzeit &lt;&lt; std::endl;
</code></pre>
<p>so zum Beispiel...<br />
Aber was ist das für ne Datei?<br />
&quot;Datum + Uhrzeit &lt;&lt;&quot;<br />
keine Endung? 2 Shifts im Dateiname sind wahrscheinlich auch nicht mit Absicht da?!<br />
Es gibt btw ne API-Fkt um wichtige Pfad herauszubekommen:<br />
<a href="http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx</a><br />
bzw.<br />
<a href="http://weseetips.com/2008/05/01/how-to-get-the-path-of-special-folders-in-windows/" rel="nofollow">http://weseetips.com/2008/05/01/how-to-get-the-path-of-special-folders-in-windows/</a></p>
<p>Hoffe mal, dass dich das weiterbringt - sieht auch ein wenig hübscher aus als nen ellenlanger Datei-Name und funktioniert wenigstens überall ^^</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669504</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669504</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Tue, 24 Feb 2009 17:14:15 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 17:46:46 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<pre><code class="language-cpp">cout&lt;&lt;&quot;Geben Sie Bitte ein Datum ein z.B. 010109 &quot;&lt;&lt;endl;
cin&gt;&gt; Datum;

cout&lt;&lt;&quot;Geben Sie Bitte die Uhrzeit ein z.B. 125959 &quot;&lt;&lt;endl;
cin&gt;&gt; Uhrzeit;

ifstream Eingabedatei(&quot;c:/Dokumente und Einstellungen/Administrator/Desktop/Datum + Uhrzeit &lt;&lt;&quot;);

Eingabedatei &lt;&lt; Datum &lt;&lt; &quot; &quot; &lt;&lt; Uhrzeit &lt;&lt; std::endl;
</code></pre>
<p>so zum Beispiel...<br />
Aber was ist das für ne Datei?<br />
&quot;Datum + Uhrzeit &lt;&lt;&quot;<br />
keine Endung? 2 Shifts im Dateiname sind wahrscheinlich auch nicht mit Absicht da?!<br />
Es gibt btw ne API-Fkt um wichtige Pfad herauszubekommen:<br />
<a href="http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb762204(VS.85).aspx</a><br />
bzw.<br />
<a href="http://weseetips.com/2008/05/01/how-to-get-the-path-of-special-folders-in-windows/" rel="nofollow">http://weseetips.com/2008/05/01/how-to-get-the-path-of-special-folders-in-windows/</a></p>
<p>Hoffe mal, dass dich das weiterbringt - sieht auch ein wenig hübscher aus als nen ellenlanger Datei-Name und funktioniert wenigstens überall ^^</p>
<p>bb</p>
</blockquote>
<p>des is ne csv Datei</p>
<p>Ich muss einfach den Speicherort (Ordner und Name der Datei) angeben diese mit ifstream einlesen verarbeiten und ausgeben.</p>
<p>Die shifts sind unabsichtlich reingerutscht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669529</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669529</guid><dc:creator><![CDATA[1Aiden]]></dc:creator><pubDate>Tue, 24 Feb 2009 17:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 17:47:25 GMT]]></title><description><![CDATA[<p>Ich frage mich, ob hier nicht ein variabler Speicherort gemeint war in Verbindung mit Datum und Uhrzeit. Also sowas:</p>
<pre><code class="language-cpp">std::cout &lt;&lt; &quot;Geben Sie Bitte ein Datum ein z.B. 010109: &quot;
          &lt;&lt; std::endl;

std::string date;
std::geline(std::cin, date);

std::cout &lt;&lt; &quot;Geben Sie Bitte die Uhrzeit ein z.B. 125959: &quot;
          &lt;&lt; std::endl;

std::string time;
std::getline(std::cin, time);

std::string path = &quot;c:/Dokumente und Einstellungen/Administrator/Desktop/&quot;;
path += date;
path += &quot; &quot;;
path += time;
path += &quot;.txt&quot;;

std::ifstream input(path.c_str());
</code></pre>
<p>Ansonsten empfehle ich, dass du das nächste Mal die Beschreibung deines Problems etwas deutlicher machst.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669530</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669530</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Tue, 24 Feb 2009 17:47:25 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 18:12:11 GMT]]></title><description><![CDATA[<p>Dravere schrieb:</p>
<blockquote>
<p>Ich frage mich, ob hier nicht ein variabler Speicherort gemeint war in Verbindung mit Datum und Uhrzeit. Also sowas:</p>
<pre><code class="language-cpp">std::cout &lt;&lt; &quot;Geben Sie Bitte ein Datum ein z.B. 010109: &quot;
          &lt;&lt; std::endl;

std::string date;
std::geline(std::cin, date);

std::cout &lt;&lt; &quot;Geben Sie Bitte die Uhrzeit ein z.B. 125959: &quot;
          &lt;&lt; std::endl;

std::string time;
std::getline(std::cin, time);

std::string path = &quot;c:/Dokumente und Einstellungen/Administrator/Desktop/&quot;;
path += date;
path += &quot; &quot;;
path += time;
path += &quot;.txt&quot;;

std::ifstream input(path.c_str());
</code></pre>
<p>Ansonsten empfehle ich, dass du das nächste Mal die Beschreibung deines Problems etwas deutlicher machst.</p>
<p>Grüssli</p>
</blockquote>
<p>Dann versuche ich das mal deutlicher:</p>
<p>ich habe ein File :<br />
010109-125959-raw.csv<br />
Datum-Uhrzeit-raw.csv</p>
<p>Diese File wird jeden Tag ein oder mehrmals erzeugt, der Anwender muss eintragen wie des File heißt, deswegen frage ich das Datum und die Zeit ab.<br />
Der Name der Datei beinhaltet also Datum-Uhrzeit.</p>
<p>Ich muss Datum und Uhrzeit zusammenpacken um das ganze in ifstream MIT ORDNERBEZEICHNUNG auslesen und verarbeiten.</p>
<p>der Pfad lautet des ordners c:/Dokumente und Einstellungen/Administrator/Desktop/</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669542</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669542</guid><dc:creator><![CDATA[1Aiden]]></dc:creator><pubDate>Tue, 24 Feb 2009 18:12:11 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 18:13:56 GMT]]></title><description><![CDATA[<p>Gut, dann war ich also doch richtig. Was stimmt denn nun nicht an meiner Lösung, abgesehen, dass man nicht &quot;.txt&quot; nehmen sollte am Ende, sondern ein &quot;-raw.csv&quot; und statt des Leerzeichen ein Bindestrich '-' dazwischen.<br />
Also frag, wenn du etwas nicht begreifst an meiner vorgeschlagenen Lösung <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>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669545</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Tue, 24 Feb 2009 18:13:56 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 18:54:56 GMT]]></title><description><![CDATA[<p>Dravere schrieb:</p>
<blockquote>
<p>Gut, dann war ich also doch richtig. Was stimmt denn nun nicht an meiner Lösung, abgesehen, dass man nicht &quot;.txt&quot; nehmen sollte am Ende, sondern ein &quot;-raw.csv&quot; und statt des Leerzeichen ein Bindestrich '-' dazwischen.<br />
Also frag, wenn du etwas nicht begreifst an meiner vorgeschlagenen Lösung <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>
<p>Grüssli</p>
</blockquote>
<pre><code class="language-csharp">std::cout &lt;&lt; &quot;Geben Sie Bitte ein Datum ein z.B. 010109: &quot;
          &lt;&lt; std::endl;

std::string date;
std::getline(std::cin, date);

std::cout &lt;&lt; &quot;Geben Sie Bitte die Uhrzeit ein z.B. 125959: &quot;
          &lt;&lt; std::endl;

std::string time;
std::getline(std::cin, time);

std::string path = &quot;c:/Dokumente und Einstellungen/Administrator/Desktop/&quot;;
path += date;
path += &quot;_&quot;;
path += time;
path += &quot;_&quot;;
path += &quot;raw&quot;;
path += &quot;.csv&quot;;

std::ifstream Eingabedatei(path.c_str());

std::cout &lt;&lt;path.c_str();
</code></pre>
<p>wenn ich das compiliere dann kommt das hier als pfad</p>
<p>c:/Dokumente und Einstellungen/Administrator/Desktop/010109__raw.</p>
<p>time fehlt da?????</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669572</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669572</guid><dc:creator><![CDATA[1Aiden]]></dc:creator><pubDate>Tue, 24 Feb 2009 18:54:56 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 19:31:17 GMT]]></title><description><![CDATA[<p>Genau diesen gezeigten Code, führt bei mir zu dieser Ausgabe:</p>
<pre><code>Geben Sie Bitte ein Datum ein z.B. 010109:
010109
Geben Sie Bitte die Uhrzeit ein z.B. 125959:
125959
c:/Dokumente und Einstellungen/Administrator/Desktop/010109_125959_raw.csv
</code></pre>
<p>Die beiden Eingaben, habe ich natürlich hingeschrieben <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>
<p>Also irgendwo hast du einen Fehler gemacht. Der liegt aber sicher nicht in dem gezeigten Code, denn dieser funktioniert einwandfrei.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669595</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Tue, 24 Feb 2009 19:31:17 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 20:29:11 GMT]]></title><description><![CDATA[<p>Dravere schrieb:</p>
<blockquote>
<p>Genau diesen gezeigten Code, führt bei mir zu dieser Ausgabe:</p>
<pre><code>Geben Sie Bitte ein Datum ein z.B. 010109:
010109
Geben Sie Bitte die Uhrzeit ein z.B. 125959:
125959
c:/Dokumente und Einstellungen/Administrator/Desktop/010109_125959_raw.csv
</code></pre>
<p>Die beiden Eingaben, habe ich natürlich hingeschrieben <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>
<p>Also irgendwo hast du einen Fehler gemacht. Der liegt aber sicher nicht in dem gezeigten Code, denn dieser funktioniert einwandfrei.</p>
<p>Grüssli</p>
</blockquote>
<p>habe das ding nochmal kopiert, und immer noch das selbe, vielleicht spinnt mein visual studio.</p>
<p>Was für nen compiler benutzt du??</p>
<p>oder vielleicht sind es die Header ??</p>
<pre><code class="language-csharp">#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;fstream&gt;        // fuer Dateizugriffe
#include &lt;cstring&gt;
#include &lt;iomanip&gt;
#include &lt;math.h&gt;
#include &lt;string&gt;

using namespace std;
</code></pre>
<p>bin für jede ideee zu haben, vielen dank Dravere</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669628</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669628</guid><dc:creator><![CDATA[1Aiden]]></dc:creator><pubDate>Tue, 24 Feb 2009 20:29:11 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 20:39:38 GMT]]></title><description><![CDATA[<p>Das einzige, was es hier zu meckern gibt ist das math.h. (eher cmath!).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669636</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 24 Feb 2009 20:39:38 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen für Speicherort bei ifstream on Tue, 24 Feb 2009 20:44:31 GMT]]></title><description><![CDATA[<p>1Aiden schrieb:</p>
<blockquote>
<p>habe das ding nochmal kopiert, und immer noch das selbe, vielleicht spinnt mein visual studio.</p>
<p>Was für nen compiler benutzt du??</p>
</blockquote>
<p>Zeig uns einen kleinen lauffähigen Code, welcher den Fehler produzierst, den du beschreibst. So können wir dir am besten helfen. Der Code sollte aber wirklich nicht zu gross sein <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>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1669641</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1669641</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Tue, 24 Feb 2009 20:44:31 GMT</pubDate></item></channel></rss>