<?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[How to compare single characters of received message?]]></title><description><![CDATA[<p dir="auto">I'm expecting this is just a simple declaration/formatting issue, but I can't work out how to compare the individual characters of a received message.</p>
<p dir="auto">I want to loop through a received message payload of 20 characters. If I find a "*" character then update a status flag.</p>
<pre><code>          bool status= false;
          for (int i=0;i&lt;20;i++){
            char *a = "*";
            char *b = message.getString()[i];
            if (strcmp(a,b) == 0){
              status = true;
            }
          }
</code></pre>
<p dir="auto">I keep getting a compile error relating to "invalid conversion from char to char* [-fpermissive]".</p>
]]></description><link>https://forum.mysensors.org/topic/9985/how-to-compare-single-characters-of-received-message</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 11:21:57 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/9985.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Dec 2018 11:13:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to compare single characters of received message? on Tue, 18 Dec 2018 12:57:03 GMT]]></title><description><![CDATA[<p dir="auto">That works, and is a lot shorter!</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.mysensors.org/post/95866</link><guid isPermaLink="true">https://forum.mysensors.org/post/95866</guid><dc:creator><![CDATA[phil2020]]></dc:creator><pubDate>Tue, 18 Dec 2018 12:57:03 GMT</pubDate></item><item><title><![CDATA[Reply to How to compare single characters of received message? on Tue, 18 Dec 2018 11:39:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phil2020" aria-label="Profile: phil2020">@<bdi>phil2020</bdi></a> this should do</p>
<pre><code>bool status = String(message.getString()).indexOf('*') != -1;
</code></pre>
]]></description><link>https://forum.mysensors.org/post/95864</link><guid isPermaLink="true">https://forum.mysensors.org/post/95864</guid><dc:creator><![CDATA[mfalkvidd]]></dc:creator><pubDate>Tue, 18 Dec 2018 11:39:57 GMT</pubDate></item></channel></rss>