<?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[sscanf leichte Frage]]></title><description><![CDATA[<p>Hi,</p>
<p>hätte ne leichte Frage für euch an der ich jetzt schon länger sitze:<br />
ich habe mit getline eine Zeile in einen String-Vektor gespeichert, dieser String heißt line und ich möchte die Zahl in den Anführungszeichen in einen Vektor namens veckp schreiben. Die zeile lautet:</p>
<p>exprs=[&quot;1&quot;;&quot;1+s&quot;],..</p>
<p>und mein Vorschlag dazu (der leider nicht funzt):</p>
<p>vector&lt;string&gt;veckp;<br />
sscanf(line, &quot; exprs=['%c';'1+s'],..&quot;, veckp[1]);</p>
<p>Bitte helft mir kurz, ich komm nicht drauf...</p>
<p>Mfg Tom</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/257874/sscanf-leichte-frage</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 20:15:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/257874.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Jan 2010 12:53:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to sscanf leichte Frage on Mon, 04 Jan 2010 12:53:07 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>hätte ne leichte Frage für euch an der ich jetzt schon länger sitze:<br />
ich habe mit getline eine Zeile in einen String-Vektor gespeichert, dieser String heißt line und ich möchte die Zahl in den Anführungszeichen in einen Vektor namens veckp schreiben. Die zeile lautet:</p>
<p>exprs=[&quot;1&quot;;&quot;1+s&quot;],..</p>
<p>und mein Vorschlag dazu (der leider nicht funzt):</p>
<p>vector&lt;string&gt;veckp;<br />
sscanf(line, &quot; exprs=['%c';'1+s'],..&quot;, veckp[1]);</p>
<p>Bitte helft mir kurz, ich komm nicht drauf...</p>
<p>Mfg Tom</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832109</guid><dc:creator><![CDATA[TomBb]]></dc:creator><pubDate>Mon, 04 Jan 2010 12:53:07 GMT</pubDate></item><item><title><![CDATA[Reply to sscanf leichte Frage on Mon, 04 Jan 2010 12:56:46 GMT]]></title><description><![CDATA[<p>Why the fuck sscanf? o0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832113</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832113</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Mon, 04 Jan 2010 12:56:46 GMT</pubDate></item><item><title><![CDATA[Reply to sscanf leichte Frage on Mon, 04 Jan 2010 12:58:30 GMT]]></title><description><![CDATA[<p>Ich dachte wenn ich nen String abscannen will bracuh ich das</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832115</guid><dc:creator><![CDATA[TomBb]]></dc:creator><pubDate>Mon, 04 Jan 2010 12:58:30 GMT</pubDate></item><item><title><![CDATA[Reply to sscanf leichte Frage on Mon, 04 Jan 2010 13:16:21 GMT]]></title><description><![CDATA[<p>TomBb schrieb:</p>
<blockquote>
<p>Ich dachte wenn ich nen String abscannen will bracuh ich das</p>
</blockquote>
<p>Eher nicht. String unterstützt die gleichen Formen von Ein-/Ausgabe wie alle nativen Datentypen in C++. Mehr noch: Es gibt eine praktische Funktion namens getline die einen Stream und einen String annimmt und dann eine Zeile aus dem Stream in den String liest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832128</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832128</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 04 Jan 2010 13:16:21 GMT</pubDate></item><item><title><![CDATA[Reply to sscanf leichte Frage on Mon, 04 Jan 2010 13:16:37 GMT]]></title><description><![CDATA[<p>fscanf funktioniert aber leider auch nicht, falls du das meintest...</p>
<p>Bitte erbarmt sich einer! <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/1832129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832129</guid><dc:creator><![CDATA[TomBb]]></dc:creator><pubDate>Mon, 04 Jan 2010 13:16:37 GMT</pubDate></item><item><title><![CDATA[Reply to sscanf leichte Frage on Mon, 04 Jan 2010 13:18:57 GMT]]></title><description><![CDATA[<p>Mit getline hab ich ja die Zeile schon in einem String-Vektor gespeichert.</p>
<p>ich brauche aus diesem String namens line nur noch den Zahlenwert der in den Anführungsstrichen steht..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832130</guid><dc:creator><![CDATA[TomBb]]></dc:creator><pubDate>Mon, 04 Jan 2010 13:18:57 GMT</pubDate></item><item><title><![CDATA[Reply to sscanf leichte Frage on Mon, 04 Jan 2010 13:22:55 GMT]]></title><description><![CDATA[<p>Dann schreib einen Lexer bzw. Parser dafür. Geht sogar schon mit den Iteratoren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832132</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Mon, 04 Jan 2010 13:22:55 GMT</pubDate></item><item><title><![CDATA[Reply to sscanf leichte Frage on Mon, 04 Jan 2010 14:59:44 GMT]]></title><description><![CDATA[<p>Zeile mit std::getline in einen std::string einlesen und einfach die Funktion substr zum Ausschneiden nutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1832199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1832199</guid><dc:creator><![CDATA[ukzukzu]]></dc:creator><pubDate>Mon, 04 Jan 2010 14:59:44 GMT</pubDate></item></channel></rss>