<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Forum Pasja Informatyki - Najnowsze z tagiem argumentów</title>
<link>https://forum.pasja-informatyki.pl/tag/argument%C3%B3w</link>
<description>Powered by Question2Answer</description>
<item>
<title>Offtop parametry funkcji</title>
<link>https://forum.pasja-informatyki.pl/599488/offtop-parametry-funkcji</link>
<description>

&lt;p&gt;Nakładka na C, coraz bardziej się rozbudowuje&amp;nbsp; ;)&lt;/p&gt;



&lt;pre class=&quot;brush:cpp;&quot;&gt;
struct LabelOptions {
    int fontSize = 12;
    std::string anchor = &quot;middle&quot;;
    std::string color = &quot;black&quot;;
};

void addLabel(int x, int y, const std::string&amp;amp; text, const LabelOptions&amp;amp; opts = {}) {
    std::cout &amp;lt;&amp;lt; &quot;x=&quot; &amp;lt;&amp;lt; x &amp;lt;&amp;lt; &quot; y=&quot; &amp;lt;&amp;lt; y &amp;lt;&amp;lt; &quot; text=&quot; &amp;lt;&amp;lt; text
              &amp;lt;&amp;lt; &quot; fontSize=&quot; &amp;lt;&amp;lt; opts.fontSize
              &amp;lt;&amp;lt; &quot; anchor=&quot; &amp;lt;&amp;lt; opts.anchor
              &amp;lt;&amp;lt; &quot; color=&quot; &amp;lt;&amp;lt; opts.color &amp;lt;&amp;lt; &quot;\n&quot;;
}

addLabel(100, 200, &quot;Hello&quot;); // używa domyślnych wartości
addLabel(100, 200, &quot;Hello&quot;, {16, &quot;end&quot;, &quot;red&quot;}); // nadpisuje wszystkie
addLabel(100, 200, &quot;Hello&quot;, {.anchor=&quot;end&quot;});    // C++20: designated initializers
&lt;/pre&gt;



&lt;p&gt;Normalnie wyścig zbrojeń z JS. Wiem, wiem język to biblioteki, a nie podstawowa składania. Ale już niekonieczna jest przemyślana kolejność argumentów.&amp;nbsp;&lt;/p&gt;</description>
<category>Offtop</category>
<guid isPermaLink="true">https://forum.pasja-informatyki.pl/599488/offtop-parametry-funkcji</guid>
<pubDate>Fri, 19 Dec 2025 22:01:22 +0000</pubDate>
</item>
</channel>
</rss>