<?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[Strukturinhalt ausrechnen]]></title><description><![CDATA[<p>hallo <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>Ich hab eine Struktur:</p>
<pre><code class="language-cpp">struct vektor
{
	int x, y;
};
</code></pre>
<p>Und hier zwei Vektoren:</p>
<pre><code class="language-cpp">vektor s_a = { 0, 0 };
vektor s_z = { 3, 4 };
</code></pre>
<p>wie kann ich die s_a x's von den s_z x's subtrahieren?</p>
<p>also hier das Beispiel, wie ich das haben möchte:</p>
<pre><code>int summe_von_sA = 0 - 3 = ..
int summe_von_sZ = 0 - 4 = ..
</code></pre>
<p>aber ich kann doch nicht einfach s_a[0] - s_z[0] schreiben, ich suche jedoch eine Möglichkeit die &quot;Parameter&quot; von der Strukt zu addieren/subtrahieren/etc.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/202009/strukturinhalt-ausrechnen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 06 Oct 2026 12:12:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/202009.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Jan 2008 16:26:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Strukturinhalt ausrechnen on Sun, 06 Jan 2008 16:26:57 GMT]]></title><description><![CDATA[<p>hallo <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>Ich hab eine Struktur:</p>
<pre><code class="language-cpp">struct vektor
{
	int x, y;
};
</code></pre>
<p>Und hier zwei Vektoren:</p>
<pre><code class="language-cpp">vektor s_a = { 0, 0 };
vektor s_z = { 3, 4 };
</code></pre>
<p>wie kann ich die s_a x's von den s_z x's subtrahieren?</p>
<p>also hier das Beispiel, wie ich das haben möchte:</p>
<pre><code>int summe_von_sA = 0 - 3 = ..
int summe_von_sZ = 0 - 4 = ..
</code></pre>
<p>aber ich kann doch nicht einfach s_a[0] - s_z[0] schreiben, ich suche jedoch eine Möglichkeit die &quot;Parameter&quot; von der Strukt zu addieren/subtrahieren/etc.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1431910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1431910</guid><dc:creator><![CDATA[struktur:)]]></dc:creator><pubDate>Sun, 06 Jan 2008 16:26:57 GMT</pubDate></item><item><title><![CDATA[Reply to Strukturinhalt ausrechnen on Sun, 06 Jan 2008 16:34:55 GMT]]></title><description><![CDATA[<p>?</p>
<pre><code class="language-cpp">struct vector
{
    int x;
    int y;
    vector(const int x, const int y)
        : x(x), y(y)
    {}
};

int main()
{
    vector vec_first(0, 10);
    vector vec_second(10, 5);
    vec_first.x += 10;
    vector vec_last(vec_first.x + vec_second.x, vec_first.y - vec_second.y); 
}
</code></pre>
<p>kannst also einfach auf die Elemente von deiner Struktur zugreifen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1431918</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1431918</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 06 Jan 2008 16:34:55 GMT</pubDate></item></channel></rss>