<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=4&amp;t=23065&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2020-04-29T21:24:02+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=23065&amp;mode</id>
<entry>
<author><name><![CDATA[heniug]]></name></author>
<updated>2020-04-29T21:24:02+01:00</updated>
<published>2020-04-29T21:24:02+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226769#p226769</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226769#p226769"/>
<title type="html"><![CDATA[Re: Jak prosto połączyć stringi]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226769#p226769"><![CDATA[
Tak  czytałem, ale lepiej przyswajam wiedzę podaną łopatologicznie.<br />Zrobiłem sobie swoje notatki, a teraz działam dalej nad swoim projektem.<br />Dzięki wszystkim za pomoc.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1890">heniug</a> — 29 kwi 2020, o 21:24</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[micky]]></name></author>
<updated>2020-04-29T11:37:54+01:00</updated>
<published>2020-04-29T11:37:54+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226739#p226739</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226739#p226739"/>
<title type="html"><![CDATA[Re: Jak prosto połączyć stringi]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226739#p226739"><![CDATA[
A zaglądałeś do manuala sprintfa? Tam jest dokładnie opisane formatowanie.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1546">micky</a> — 29 kwi 2020, o 11:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[heniug]]></name></author>
<updated>2020-04-29T09:39:50+01:00</updated>
<published>2020-04-29T09:39:50+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226734#p226734</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226734#p226734"/>
<title type="html"><![CDATA[Re: Jak prosto połączyć stringi]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226734#p226734"><![CDATA[
dzięki za odpowiedź anshar, <br />mam tylko prośbę o wytłumaczenie znaczenia %s w składni<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1890">heniug</a> — 29 kwi 2020, o 09:39</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[anshar]]></name></author>
<updated>2020-04-28T23:42:48+01:00</updated>
<published>2020-04-28T23:42:48+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226730#p226730</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226730#p226730"/>
<title type="html"><![CDATA[Re: Jak prosto połączyć stringi]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226730#p226730"><![CDATA[
[syntax=c]#include &lt;stdio.h&gt;<br />#include &lt;string.h&gt; //dla strcpy() i strcat()<br /><br />int main()<br />{<br />    char text1&#91;25&#93; = &quot;temperatura w pokoju &quot;;<br />    char text2&#91;25&#93; = &quot; temperatura zewnetrzna &quot;;<br />    char temperatura1&#91;6&#93; = &quot;25.4C&quot;;<br />    char temperatura2&#91;6&#93; = &quot;23.2C&quot;;<br />    <br />    char wynik&#91;100&#93;; // text1+temperatura1+text2+temperatura2;// jak to zrealizować<br />    <br />    strcpy(wynik, text1);<br />    strcat(wynik, temperatura1);<br />    strcat(wynik, text2);<br />    strcat(wynik, temperatura2);<br />    printf(&quot;%s&quot;, wynik);<br /><br />    return 0;<br />}[/syntax]<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 6 minutach ]</span></strong><br /><br />[syntax=c]#include &lt;stdio.h&gt;<br /><br />int main()<br />{<br />    <br />    char text1&#91;25&#93; = &quot;temperatura w pokoju&quot;;<br />    char text2&#91;25&#93; = &quot;temperatura zewnetrzna&quot;;<br />    char temperatura1&#91;6&#93; = &quot;25.4C&quot;;<br />    char temperatura2&#91;6&#93; = &quot;23.2C&quot;;<br />    <br />    char wynik&#91;100&#93;; // text1+temperatura1+text2+temperatura2;// jak to zrealizować<br />    <br />    sprintf(wynik, &quot;%s %s %s %s&quot;, text1, temperatura1, text2, temperatura2);<br />    printf(&quot;%s&quot;, wynik);<br /><br />    return 0;<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7157">anshar</a> — 28 kwi 2020, o 23:42</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[heniug]]></name></author>
<updated>2020-04-28T21:19:06+01:00</updated>
<published>2020-04-28T21:19:06+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226728#p226728</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226728#p226728"/>
<title type="html"><![CDATA[Re: Jak prosto połączyć stringi]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226728#p226728"><![CDATA[
Sprawdziłem i jednak nie działa.<br />Wyświetla się tekst &quot;Temperatura w pokoju: &quot; ale nie dodaje wyniku pomiaru temperatury<br />Może inaczej dodajmy te stringi bo sprawa dotyczy łącznie dwóch czujników:<br />char text1[25]=&quot;temperatura w pokoju&quot;;<br />char text2[25]=&quot;temperatura zewnętrzna&quot;;<br />char temperatura1[6];<br />char temperatura2[6];<br />char wynik[100]= text1+temperatura1+text2+temperatura2;// jak to zrealizować<br /><br />dziękuję za wszelkie wskazówki i pomoc<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1890">heniug</a> — 28 kwi 2020, o 21:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[heniug]]></name></author>
<updated>2020-04-27T19:46:06+01:00</updated>
<published>2020-04-27T19:46:06+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226710#p226710</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226710#p226710"/>
<title type="html"><![CDATA[Re: Jak prosto połączyć stringi]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226710#p226710"><![CDATA[
Dzięki Mirku za wskazówkę, zaczynam sobie testowanie.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1890">heniug</a> — 27 kwi 2020, o 19:46</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2020-04-27T19:22:01+01:00</updated>
<published>2020-04-27T19:22:01+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226709#p226709</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226709#p226709"/>
<title type="html"><![CDATA[Re: Jak prosto połączyć stringi]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226709#p226709"><![CDATA[
jest wiele metod, musisz się zainteresować standardowymi funkcjami w C, jak np strcat() albo sprintf()<br /><br />np:<br /><br />[syntax=c]char buf&#91;50&#93;;<br />char znak = ' ';<br />if( subzero ) znak = '-';<br />sprintf( buf, &quot;Temperatura w pokoju: %s%d,%d C&quot;, znak, cel, cel_fract_bits );[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 27 kwi 2020, o 19:22</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[heniug]]></name></author>
<updated>2020-04-27T18:59:39+01:00</updated>
<published>2020-04-27T18:59:39+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226708#p226708</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226708#p226708"/>
<title type="html"><![CDATA[Jak prosto połączyć stringi]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=23065&amp;p=226708#p226708"><![CDATA[
Witam<br />Banalne pytanie a jednak problem.<br />Poniżej wycinek kodu z pomiaru temperatury i tworzenia stringa jest ok, ale mam brak umiejętności jak połączyć ze sobą kilka stringów.<br />np.<br />char wynik[]= &quot;Temperatura w pokoju: &quot; + temperatura10 +&quot;C&quot; <br /><br /><br />[syntax=c]if(DS18X20_OK == DS18X20_read_meas(gSensorIDs&#91;1&#93;, &amp;subzero, &amp;cel, &amp;cel_fract_bits))<br />                                 {<br />                       // składamy wartość temperatury w string - temperatura&#91;&#93;<br />                                             char * twsk = temperatura10;<br />                         if( !subzero )  *(twsk++) = ' ';<br />                                             else *(twsk++) = '-';<br />                                             if( cel&lt;10 ) *(twsk++) = ' ';<br />                                             itoa( cel, twsk++, 10 );<br />                                             if( cel&gt;9 ) twsk++;<br />                                              *(twsk++) = '.';<br />                                             itoa( cel_fract_bits, twsk++, 10 );<br />                                             *(twsk++) = 0;[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1890">heniug</a> — 27 kwi 2020, o 18:59</p><hr />
]]></content>
</entry>
</feed>