<?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[römische Zahlen]]></title><description><![CDATA[<p>Hallo zusammen, vllt kann mir jemand von euch helfen, soll für die Schule ein Programm mit Borland Developement Studio 2006 schreiben. In dem Programm sollen wir römische in arabische Zahlen umwandeln. Leider gibt er mir immer einen Linker Fehler aus und ich weiß nicht warum! Ich muss dazu sagen, das ich eher ein Neuling bin.</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::Button2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int i=0,ausgabe=0,l;
int Length();
int LetterToInt(int letter)
String eingabe;
eingabe=Edit1-&gt;Text;
for(i=0;i&lt;eingabe.Length();i++)
{
		if((i+1)&lt;=eingabe.Length())
		{
			if(LetterToInt(eingabe[i])&lt;LetterToInt(eingabe[i+1]))
			{
				ausgabe -= LetterToInt(eingabe[i]);
			}
			else
			{
				ausgabe += LetterToInt(eingabe[i]);
			}
		}
		else if(i==eingabe.Length())
		{
			ausgabe += LetterToInt(eingabe[i]);
		}
}
Edit2-&gt;Text=IntToStr(ausgabe);
}

int LetterToInt(char letter)
{
	switch(letter)
	{
		case 'M': return 1000;
		case 'D': return 500;
		case 'C': return 100;
		case 'L': return 50;
		case 'X': return 10;
		case 'V': return 5;
		case 'I': return 1;
		default:  return -1;
	}
}
</code></pre>
<p>Der Fehler lautet dann:<br />
[Linker Fehler] Error: Ungelöste externe 'LetterToInt(int)' referenziert von J:\C++\ZAHLEN\DEBUG_BUILD\UNIT1.OBJ</p>
<p>Wie kann ich das beheben bzw. was habe ich nicht beachtet?</p>
<p>Gruß N3M0</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/184970/römische-zahlen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 06:31:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/184970.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Jun 2007 17:39:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to römische Zahlen on Wed, 20 Jun 2007 17:39:28 GMT]]></title><description><![CDATA[<p>Hallo zusammen, vllt kann mir jemand von euch helfen, soll für die Schule ein Programm mit Borland Developement Studio 2006 schreiben. In dem Programm sollen wir römische in arabische Zahlen umwandeln. Leider gibt er mir immer einen Linker Fehler aus und ich weiß nicht warum! Ich muss dazu sagen, das ich eher ein Neuling bin.</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::Button2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int i=0,ausgabe=0,l;
int Length();
int LetterToInt(int letter)
String eingabe;
eingabe=Edit1-&gt;Text;
for(i=0;i&lt;eingabe.Length();i++)
{
		if((i+1)&lt;=eingabe.Length())
		{
			if(LetterToInt(eingabe[i])&lt;LetterToInt(eingabe[i+1]))
			{
				ausgabe -= LetterToInt(eingabe[i]);
			}
			else
			{
				ausgabe += LetterToInt(eingabe[i]);
			}
		}
		else if(i==eingabe.Length())
		{
			ausgabe += LetterToInt(eingabe[i]);
		}
}
Edit2-&gt;Text=IntToStr(ausgabe);
}

int LetterToInt(char letter)
{
	switch(letter)
	{
		case 'M': return 1000;
		case 'D': return 500;
		case 'C': return 100;
		case 'L': return 50;
		case 'X': return 10;
		case 'V': return 5;
		case 'I': return 1;
		default:  return -1;
	}
}
</code></pre>
<p>Der Fehler lautet dann:<br />
[Linker Fehler] Error: Ungelöste externe 'LetterToInt(int)' referenziert von J:\C++\ZAHLEN\DEBUG_BUILD\UNIT1.OBJ</p>
<p>Wie kann ich das beheben bzw. was habe ich nicht beachtet?</p>
<p>Gruß N3M0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1310133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310133</guid><dc:creator><![CDATA[N3M081]]></dc:creator><pubDate>Wed, 20 Jun 2007 17:39:28 GMT</pubDate></item><item><title><![CDATA[Reply to römische Zahlen on Wed, 20 Jun 2007 18:29:52 GMT]]></title><description><![CDATA[<p>ok, den Fehler hab ich gefunden, hatte in der Funktionsdeklaration nicht char stehen, sondern int</p>
<p>soweit kompiliert er jetzt auch alles, leider kommt nun, wenn ich Button1 klicke ein weiterer Fehler:</p>
<p>Zugriffsvertzung bei Adresse 51F07A07 in Modul 'rtl100.bpl'. Lesen von Adresse 001AE860.<br />
Was das nu wieder?</p>
<p>Gruß N3M0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1310160</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310160</guid><dc:creator><![CDATA[n3m081]]></dc:creator><pubDate>Wed, 20 Jun 2007 18:29:52 GMT</pubDate></item><item><title><![CDATA[Reply to römische Zahlen on Wed, 20 Jun 2007 18:45:08 GMT]]></title><description><![CDATA[<p>ich glaub da haste dich ein bissl mit der switch anweisung vertahen...</p>
<pre><code class="language-cpp">char LetterToInt(int number) 
{ 
    switch(number) 
    { 
        case 1000: return 'M'; 
        ...  
    } 
}
</code></pre>
<p>(nich getestet, da ich nich zuhaus bin)</p>
<p>ich denke ma das da der fehler steckt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1310168</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310168</guid><dc:creator><![CDATA[majin]]></dc:creator><pubDate>Wed, 20 Jun 2007 18:45:08 GMT</pubDate></item><item><title><![CDATA[Reply to römische Zahlen on Wed, 20 Jun 2007 18:59:53 GMT]]></title><description><![CDATA[<p>vielleicht hab ich das auch verwechselt ... aber der benutzer soll M, C, L usw. eingeben und die Ausgabe erfolgt dann in Dezimalzahlen ... also denke ich, dass die switch richtig sein sollte, oder? sorry für das missverständnis</p>
<p>gruß n3m0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1310173</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310173</guid><dc:creator><![CDATA[n3m081]]></dc:creator><pubDate>Wed, 20 Jun 2007 18:59:53 GMT</pubDate></item><item><title><![CDATA[Reply to römische Zahlen on Wed, 20 Jun 2007 20:30:59 GMT]]></title><description><![CDATA[<p>n3m081 schrieb:</p>
<blockquote>
<p>soweit kompiliert er jetzt auch alles, leider kommt nun, wenn ich Button1 klicke ein weiterer Fehler</p>
</blockquote>
<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39301.html" rel="nofollow">In welcher Zeile?</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1310226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310226</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Wed, 20 Jun 2007 20:30:59 GMT</pubDate></item><item><title><![CDATA[Reply to römische Zahlen on Wed, 20 Jun 2007 22:03:24 GMT]]></title><description><![CDATA[<p>Abend!</p>
<p>Beliebter Fehler: AnsiString [] beginnt nicht bei 0 sonder bei 1!<br />
Demnach Zeile 27:</p>
<pre><code class="language-cpp">for(i=1;i&lt;eingabe.Length()+1;i++)
</code></pre>
<p>Hab's nicht ausprobiert, der Fehler sollte dann aber schon mal weg sein.</p>
<p>Gruß<br />
Markus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1310275</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1310275</guid><dc:creator><![CDATA[HMarkus]]></dc:creator><pubDate>Wed, 20 Jun 2007 22:03:24 GMT</pubDate></item></channel></rss>