<?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[copying byte to Qstring]]></title><description><![CDATA[<p dir="auto">hi<br />
i am getting an error while using the strcpy</p>
<p dir="auto">strcpy(arr[i][j], str); here arr is a 2D array and str is Qstring</p>
<p dir="auto">i tried using qstrcpy also still the same error<br />
error says i cannot copy a connst char * to QString</p>
<p dir="auto">i canot change the data type of both of them because it is used in many places in the prooject and i need arr as 2D array only same with the str also i cannot change its datatype</p>
<p dir="auto">this is very urgent please someone help me out thanks in advance</p>
]]></description><link>https://forum.qt.io/topic/132124/copying-byte-to-qstring</link><generator>RSS for Node</generator><lastBuildDate>Wed, 07 Oct 2026 09:15:00 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/132124.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Nov 2021 02:59:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to copying byte to Qstring on Fri, 19 Nov 2021 05:24:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/seok">@<bdi>seok</bdi></a> said in <a href="/post/690771">copying byte to Qstring</a>:</p>
<blockquote>
<p dir="auto">error says i cannot copy a connst char * to QString</p>
</blockquote>
<p dir="auto">Of course, strcpy has no idea what QString is (check its signature).<br />
Why do you want to use strcpy in a C++ Qt application?<br />
You can use <a href="https://doc.qt.io/qt-5/qstring.html#append-1" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qstring.html#append-1</a> instead.</p>
<pre><code>str.append(QChar(arr[i][j]));
</code></pre>
]]></description><link>https://forum.qt.io/post/690780</link><guid isPermaLink="true">https://forum.qt.io/post/690780</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Fri, 19 Nov 2021 05:24:30 GMT</pubDate></item><item><title><![CDATA[Reply to copying byte to Qstring on Fri, 19 Nov 2021 04:23:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ahmad122">@<bdi>ahmad122</bdi></a> i will try this thank you</p>
]]></description><link>https://forum.qt.io/post/690775</link><guid isPermaLink="true">https://forum.qt.io/post/690775</guid><dc:creator><![CDATA[seok]]></dc:creator><pubDate>Fri, 19 Nov 2021 04:23:52 GMT</pubDate></item><item><title><![CDATA[Reply to copying byte to Qstring on Fri, 19 Nov 2021 03:56:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/seok">@<bdi>seok</bdi></a> said in <a href="/post/690771">copying byte to Qstring</a>:</p>
<blockquote>
<p dir="auto">strcpy(arr[i][j]<br />
Try using this one:<br />
strcpy(arr[i][j], str.toStdString().c_str());<br />
or<br />
qstrcpy(arr[i][j], str.toStdString().c_str());</p>
</blockquote>
]]></description><link>https://forum.qt.io/post/690774</link><guid isPermaLink="true">https://forum.qt.io/post/690774</guid><dc:creator><![CDATA[ahmad122]]></dc:creator><pubDate>Fri, 19 Nov 2021 03:56:02 GMT</pubDate></item></channel></rss>