<?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[bool isInString]]></title><description><![CDATA[<p>Ich habe &quot;leichte&quot; Probleme, diese Aufgabe zu lösen.</p>
<p>U.a. erhalte ich folgende Fehlermeldung:<br />
q:\informationstechnik\aufg2\aufg2\aufg2.cpp(22) : error C2065: 's1': nichtdeklarierter Bezeichner<br />
q:\informationstechnik\aufg2\aufg2\aufg2.cpp(23) : error C2563: Listen der formalen Parameter stimmen nicht überein<br />
q:\informationstechnik\aufg2\aufg2\aufg2.cpp(23) : error C2568: '&lt;&lt;': Auflösung der Funktionsüberladung nicht möglich</p>
<p>Danke, wenn sich jemand aufopfert und mir einen Tipp geben kann.</p>
<pre><code class="language-cpp">// Aufg2.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
/* Schreibe eine Funktion mit dem Funktionskopf: bool isInString(sring s1, string s2), die überprüft, ob der erste String im zweiten enthalten ist. */

#include &quot;stdafx.h&quot;
#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

bool isInString (string s1, string s2)
{
	if(isInString(s1, s2))
        return true;
	else
		return false;
}
int main ()
{
	cout &lt;&lt; &quot;Ist string s1 in string s2 enthalten?&quot;
		 &lt;&lt;endl;

	cout &lt;&lt; s1 = &quot;Hallo&quot;
	 	 &lt;&lt;endl;

	cout &lt;&lt; s2 = &quot;Hallo, wie geht´s?&quot;
		 &lt;&lt;endl;

	if (isInString (s1, s2))
		{
			cout &lt;&lt; &quot;Ja.&quot;
			&lt;&lt;endl;
		} 
		else
		{	
			cout &lt;&lt; &quot;Nein.&quot;
			&lt;&lt;endl;
		}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/182720/bool-isinstring</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 12:10:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/182720.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 May 2007 14:35:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to bool isInString on Mon, 28 May 2007 14:35:36 GMT]]></title><description><![CDATA[<p>Ich habe &quot;leichte&quot; Probleme, diese Aufgabe zu lösen.</p>
<p>U.a. erhalte ich folgende Fehlermeldung:<br />
q:\informationstechnik\aufg2\aufg2\aufg2.cpp(22) : error C2065: 's1': nichtdeklarierter Bezeichner<br />
q:\informationstechnik\aufg2\aufg2\aufg2.cpp(23) : error C2563: Listen der formalen Parameter stimmen nicht überein<br />
q:\informationstechnik\aufg2\aufg2\aufg2.cpp(23) : error C2568: '&lt;&lt;': Auflösung der Funktionsüberladung nicht möglich</p>
<p>Danke, wenn sich jemand aufopfert und mir einen Tipp geben kann.</p>
<pre><code class="language-cpp">// Aufg2.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
/* Schreibe eine Funktion mit dem Funktionskopf: bool isInString(sring s1, string s2), die überprüft, ob der erste String im zweiten enthalten ist. */

#include &quot;stdafx.h&quot;
#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

bool isInString (string s1, string s2)
{
	if(isInString(s1, s2))
        return true;
	else
		return false;
}
int main ()
{
	cout &lt;&lt; &quot;Ist string s1 in string s2 enthalten?&quot;
		 &lt;&lt;endl;

	cout &lt;&lt; s1 = &quot;Hallo&quot;
	 	 &lt;&lt;endl;

	cout &lt;&lt; s2 = &quot;Hallo, wie geht´s?&quot;
		 &lt;&lt;endl;

	if (isInString (s1, s2))
		{
			cout &lt;&lt; &quot;Ja.&quot;
			&lt;&lt;endl;
		} 
		else
		{	
			cout &lt;&lt; &quot;Nein.&quot;
			&lt;&lt;endl;
		}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1293812</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293812</guid><dc:creator><![CDATA[Flugsie]]></dc:creator><pubDate>Mon, 28 May 2007 14:35:36 GMT</pubDate></item><item><title><![CDATA[Reply to bool isInString on Mon, 28 May 2007 14:41:45 GMT]]></title><description><![CDATA[<p>Ich würde dir das lesen eines C++ Tutorials empfehlen. &quot;Thinking in C++&quot; bekommst du zB als kostenloses eBook...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293815</guid><dc:creator><![CDATA[rüdiger]]></dc:creator><pubDate>Mon, 28 May 2007 14:41:45 GMT</pubDate></item><item><title><![CDATA[Reply to bool isInString on Mon, 28 May 2007 14:53:08 GMT]]></title><description><![CDATA[<p>Thinking in C++ habe ich seit gestern Abend in pdf-Form.<br />
Leider, leider absolut unübersichtlich und dann noch in Englisch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293820</guid><dc:creator><![CDATA[Flugsie]]></dc:creator><pubDate>Mon, 28 May 2007 14:53:08 GMT</pubDate></item><item><title><![CDATA[Reply to bool isInString on Mon, 28 May 2007 14:53:20 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">bool isInString (string s1, string s2)
{
    return s1.find(s2) != std::string::npos;
}
</code></pre>
<p>so oder so ähnlich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293821</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293821</guid><dc:creator><![CDATA[lsdaf]]></dc:creator><pubDate>Mon, 28 May 2007 14:53:20 GMT</pubDate></item><item><title><![CDATA[Reply to bool isInString on Mon, 28 May 2007 15:50:41 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;

bool isInString(const std::string&amp;, const std::string&amp;);

int main()
{
    std::cout &lt;&lt; &quot;IN String V1.0&quot; &lt;&lt; std::endl;
    std::cout &lt;&lt; &quot;String 1: &quot; &lt;&lt; std::flush;
    std::string s1;
    std::getline(std::cin, s1);
    std::cout &lt;&lt; &quot;String 2: &quot; &lt;&lt; std::flush;
    std::string s1;
    std::getline(std::cin, s2);
    std::cout &lt;&lt; (isInString(s1, s2) == true ? &quot;Enthalten!&quot; : &quot;Nicht enthalten!&quot;) &lt;&lt; std::endl; 
}

bool isInString (const std::string&amp; s1, const std::string&amp; s2)
{
    return (s1.find(s2) != std::string::npos);
}
</code></pre>
<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1293872</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1293872</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 28 May 2007 15:50:41 GMT</pubDate></item><item><title><![CDATA[Reply to bool isInString on Sun, 10 Jun 2007 14:59:03 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>wenn ich nun allerdings das beispiel von ganz oben einsetze, funktioniert es nicht. also string1: &quot;Anna&quot; und string2: &quot;Hier wohnt Anna&quot;. dann gibt das programm aus, dass es nicht enthalten ist.</p>
<p>wie muss man das programm ändern damit es auch auf diese weise geht??</p>
<p>//edit:</p>
<p>ok habs....</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &lt;iostream&gt; 
#include &lt;string&gt; 

bool isInString(const std::string&amp;, const std::string&amp;); 

int main() 
{ 
    std::cout &lt;&lt; &quot;IN String V1.0&quot; &lt;&lt; std::endl; 
    std::cout &lt;&lt; &quot;String 1: &quot; &lt;&lt; std::flush; 
    std::string s1; 
    std::getline(std::cin, s1); 
    std::cout &lt;&lt; &quot;String 2: &quot; &lt;&lt; std::flush; 
    std::string s2; 
    std::getline(std::cin, s2); 
    std::cout &lt;&lt; (isInString(s1, s2) == true ? &quot;Enthalten!&quot; : &quot;Nicht enthalten!&quot;) &lt;&lt; std::endl; 
} 

bool isInString (const std::string&amp; s1, const std::string&amp; s2) 
{ 
    return (s1.find(s2) != std::string::npos) ||
	 (s2.find(s1) != std::string::npos);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1302531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1302531</guid><dc:creator><![CDATA[nitram58]]></dc:creator><pubDate>Sun, 10 Jun 2007 14:59:03 GMT</pubDate></item><item><title><![CDATA[Reply to bool isInString on Sun, 10 Jun 2007 15:02:44 GMT]]></title><description><![CDATA[<p>string2 ist ja auch nicht in string1 enthalten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1302536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1302536</guid><dc:creator><![CDATA[?????]]></dc:creator><pubDate>Sun, 10 Jun 2007 15:02:44 GMT</pubDate></item><item><title><![CDATA[Reply to bool isInString on Sun, 10 Jun 2007 15:03:52 GMT]]></title><description><![CDATA[<p>Und deine Änderung ist nicht wirklich korrekt ... du willst ja gucken ob 1. im 2. und nicht ob 2. in 1. String enthalten ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1302538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1302538</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 10 Jun 2007 15:03:52 GMT</pubDate></item></channel></rss>