<?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[binär floats einlesen]]></title><description><![CDATA[<p>Ahoi,</p>
<p>ich möchte an einer speziellen stelle in einer datei mehrere floats einlesen.</p>
<pre><code>ifstream file(&quot;bla bla&quot;.c_str(), ios::binary);
	vtk_file.seekg(position);
	float korn_f=-1;

	for (int i = 0; i &lt; anzahl; ++i) {

		korn_f=vtk_file.get();
		cout &lt;&lt;korn_f &lt;&lt; endl;
	}
</code></pre>
<p>hab irgendwo gelesen das man damit nur ints bekommt.<br />
habs auch schon mit read versucht und dann ein char array der größe 4 wieder in einen float um zu wandeln.<br />
alles ohne erfolg. hoffe ihr habt ne idee <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>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/308493/binär-floats-einlesen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 05 Aug 2026 18:05:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/308493.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Sep 2012 17:12:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to binär floats einlesen on Wed, 26 Sep 2012 17:12:39 GMT]]></title><description><![CDATA[<p>Ahoi,</p>
<p>ich möchte an einer speziellen stelle in einer datei mehrere floats einlesen.</p>
<pre><code>ifstream file(&quot;bla bla&quot;.c_str(), ios::binary);
	vtk_file.seekg(position);
	float korn_f=-1;

	for (int i = 0; i &lt; anzahl; ++i) {

		korn_f=vtk_file.get();
		cout &lt;&lt;korn_f &lt;&lt; endl;
	}
</code></pre>
<p>hab irgendwo gelesen das man damit nur ints bekommt.<br />
habs auch schon mit read versucht und dann ein char array der größe 4 wieder in einen float um zu wandeln.<br />
alles ohne erfolg. hoffe ihr habt ne idee <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>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254719</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254719</guid><dc:creator><![CDATA[Rustyspoon]]></dc:creator><pubDate>Wed, 26 Sep 2012 17:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to binär floats einlesen on Wed, 26 Sep 2012 17:16:43 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">file.read(reinterpret_cast&lt;char*&gt;(&amp;korn_f), sizeof korn_f);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2254722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254722</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Wed, 26 Sep 2012 17:16:43 GMT</pubDate></item></channel></rss>