<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Copy a string.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18646/copy-a-string</link><description>I need to copy a string, but i don&amp;#39;t know how to define nor how to copy. 
 This is the string that i have to copy dev_name.p_data. 
 I use soft device S130 in NRF51</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Dec 2016 23:27:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18646/copy-a-string" /><item><title>RE: Copy a string.</title><link>https://devzone.nordicsemi.com/thread/72032?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 23:27:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9779297c-a8e8-4084-9e4c-901593811007</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use &lt;a href="https://www.tutorialspoint.com/c_standard_library/c_function_memcpy.htm"&gt;memcpy&lt;/a&gt; for that.&lt;/p&gt;
&lt;p&gt;You can copy the content of dev_name.p_data to device_name like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;char device_name[31];
memcpy(device_name, dev_name.p_data, dev_name.data_len);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>