<?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[Teil eines Strings in char umwandeln]]></title><description><![CDATA[<p>Ich hab es so probiert: (die Fehlermeldung ist auch gleich dabei)</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
char mychar = RichEdit1-&gt;Lines-&gt;Strings[0][0];
/*
---------------------------
Debugger Exception Notification
---------------------------
Project Project2.exe raised exception class EAccessViolation with message
'Access violation at address 40009720 in module 'rtl60.bpl'.
Read of address 78982603'. Process stopped. Use Step or Run to continue.
---------------------------
OK   Help
---------------------------
*/
}
//---------------------------------------------------------------------------
</code></pre>
<p>in dem RichEdit steht &quot;RichEdit1&quot;, is also nicht leer.<br />
Warum nur geht das nicht???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/84364/teil-eines-strings-in-char-umwandeln</link><generator>RSS for Node</generator><lastBuildDate>Thu, 02 Jul 2026 22:21:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/84364.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Aug 2004 15:02:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Teil eines Strings in char umwandeln on Sun, 29 Aug 2004 15:02:06 GMT]]></title><description><![CDATA[<p>Ich hab es so probiert: (die Fehlermeldung ist auch gleich dabei)</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::FormCreate(TObject *Sender)
{
char mychar = RichEdit1-&gt;Lines-&gt;Strings[0][0];
/*
---------------------------
Debugger Exception Notification
---------------------------
Project Project2.exe raised exception class EAccessViolation with message
'Access violation at address 40009720 in module 'rtl60.bpl'.
Read of address 78982603'. Process stopped. Use Step or Run to continue.
---------------------------
OK   Help
---------------------------
*/
}
//---------------------------------------------------------------------------
</code></pre>
<p>in dem RichEdit steht &quot;RichEdit1&quot;, is also nicht leer.<br />
Warum nur geht das nicht???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/594574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/594574</guid><dc:creator><![CDATA[snOOfy]]></dc:creator><pubDate>Sun, 29 Aug 2004 15:02:06 GMT</pubDate></item><item><title><![CDATA[Reply to Teil eines Strings in char umwandeln on Sun, 29 Aug 2004 17:12:38 GMT]]></title><description><![CDATA[<p>aus delphi kenn ich das, dass ansistrings bei &quot;eins&quot; anfangen, probier mal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/594674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/594674</guid><dc:creator><![CDATA[c.rackwitz]]></dc:creator><pubDate>Sun, 29 Aug 2004 17:12:38 GMT</pubDate></item><item><title><![CDATA[Reply to Teil eines Strings in char umwandeln on Mon, 30 Aug 2004 07:16:17 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>So sollte es gehen:</p>
<pre><code class="language-cpp">char *mychar ;                                    // Pointer auf einen char

mychar =  RichEdit1-&gt;Lines-&gt;Strings[0].c_str();   // den Ansistring aus RichEdit mit c_str()
                                                  // in einen solchen umwandeln...

Label1-&gt;Caption= mychar;                          // zur Kontrolle wieder ausgeben
</code></pre>
<p>.....Strings[0][0] gibt es meines Wissens nach nicht!</p>
<p>Nagel mich drauf fest. Suche in der Hilfe nach Pointer und / oder probiere es aus... <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>Gruß<br />
Timmy</p>
]]></description><link>https://www.c-plusplus.net/forum/post/594916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/594916</guid><dc:creator><![CDATA[superninny79]]></dc:creator><pubDate>Mon, 30 Aug 2004 07:16:17 GMT</pubDate></item><item><title><![CDATA[Reply to Teil eines Strings in char umwandeln on Mon, 30 Aug 2004 07:33:31 GMT]]></title><description><![CDATA[<p>Wenn du allerdings nur auf das erste, bzw. irgendein Zeichen zugreifen willst, nimmst du:</p>
<pre><code class="language-cpp">mychar =  RichEdit1-&gt;Lines-&gt;Strings[0].SubString(1,1).c_str();
</code></pre>
<p>Gruß<br />
Timmy</p>
]]></description><link>https://www.c-plusplus.net/forum/post/594925</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/594925</guid><dc:creator><![CDATA[SuperNinny79]]></dc:creator><pubDate>Mon, 30 Aug 2004 07:33:31 GMT</pubDate></item><item><title><![CDATA[Reply to Teil eines Strings in char umwandeln on Mon, 30 Aug 2004 07:45:41 GMT]]></title><description><![CDATA[<p>superninny79 schrieb:</p>
<blockquote>
<p>Strings[0][0] gibt es meines Wissens nach nicht!</p>
</blockquote>
<p>Gibt es wohl, sieh dir mal die AnsiString-Operatoren an. Nur dass der Index von AnsiString eben, wie von c.rackwitz erwähnt, bei 1 beginnt, nicht bei 0. Ansonsten ist BlackShadows Ansatz korrekt.</p>
<p>Da normalerweise aber anstelle der AccessViolation eine Exception auftreten müsste (ERangeError o.ä.) vermute ich mal, dass seine Fehlermeldung anderswo im Code verursacht wird. Oder er benutzt eine alte BCB-Version, in der es noch keine entsprechende Exception gab.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/594930</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/594930</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Mon, 30 Aug 2004 07:45:41 GMT</pubDate></item><item><title><![CDATA[Reply to Teil eines Strings in char umwandeln on Mon, 30 Aug 2004 08:21:02 GMT]]></title><description><![CDATA[<p>Ich habe nix gesagt und behaupte das Gegenteil...</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/594966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/594966</guid><dc:creator><![CDATA[SuperNinny79]]></dc:creator><pubDate>Mon, 30 Aug 2004 08:21:02 GMT</pubDate></item><item><title><![CDATA[Reply to Teil eines Strings in char umwandeln on Wed, 01 Sep 2004 14:01:53 GMT]]></title><description><![CDATA[<p>char mychar = RichEdit1-&gt;Lines-&gt;Text[1];</p>
]]></description><link>https://www.c-plusplus.net/forum/post/597051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/597051</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Wed, 01 Sep 2004 14:01:53 GMT</pubDate></item><item><title><![CDATA[Reply to Teil eines Strings in char umwandeln on Thu, 02 Sep 2004 17:44:21 GMT]]></title><description><![CDATA[<blockquote>
<p>aus delphi kenn ich das, dass ansistrings bei &quot;eins&quot; anfangen, probier mal</p>
</blockquote>
<p>Jo, so ist es! Irgendwie ein blödes System, wo doch alles andere auch bei 0 anfängt.</p>
<blockquote>
<p>Da normalerweise aber anstelle der AccessViolation eine Exception auftreten müsste (ERangeError o.ä.) vermute ich mal, dass seine Fehlermeldung anderswo im Code verursacht wird</p>
</blockquote>
<p>Nee, das war das einzige, was im Quelltext stand (außer dem Anfangs-Standard-Kram).<br />
Ich benutze BC++ Builder 6.0 Enterprise, sollte also nicht veraltet sein.</p>
<p>Aber egal, Problem gelöst! Danke für eure Antworten!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/598169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/598169</guid><dc:creator><![CDATA[snOOfy]]></dc:creator><pubDate>Thu, 02 Sep 2004 17:44:21 GMT</pubDate></item></channel></rss>