:strcpy](http://en.cppreference.com/w/cpp/string/byte/strcpy)(dst, std::[ranges::cdata](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/cdata)(src));
        // [data(src), data(src) + size(src)] is guaranteed to be an NTBS
     
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << dst;
    }

Output:

    
    
    Hello world!

###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/cdata&action=edit&section=2
"Edit section: See also") ]  See also

[ ranges::data  ](/w/cpp/ranges/data "cpp/ranges/data") (C++20)  |  obtains a pointer to the beginning of a contiguous range   
(customization point object)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_data&action=edit)  
---|---  
[ data  ](/w/cpp/iterator/data "cpp/iterator/data") (C++17)  |  obtains the pointer to the underlying array   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_data&action=edit)  
  
Retrieved from " [
https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/cdata&oldid=158250
](https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/cdata&oldid=158250)
"

#####  Navigation

  * [ Support us ](http://www.cppreference.com/support)
  * [ Recent changes ](/w/Special:RecentChanges "A list of recent changes in the wiki \[r\]")
  * [ FAQ ](/w/Cppreference:FAQ)
  * [ Offline version ](/w/Cppreference:Archives)

#####  Toolbox

  * [ What links here ](/w/Special:WhatLinksHere/cpp/ranges/cdata "A list of all wiki pages that link here \[j\]")
  * [ Related changes ](/w/Special:RecentChangesLinked/cpp/ranges/cdata "Recent changes in pages linked from this page \[k\]")
  * [ Upload file ](http://upload.cppreference.com/w/Special:Upload "Upload files \[u\]")
  * [ Special pages ](/w/Special:SpecialPages "A list of all special pages \[q\]")
  * [ Printable version ](/mwiki/index.php?title=cpp/ranges/cdata&printable=yes "Printable version of this page \[p\]")
  * [ Permanent link ](/mwiki/index.php?title=cpp/ranges/cdata&oldid=158250 "Permanent link to this revision of the page")
  * [ Page information ](/mwiki/index.php?title=cpp/ranges/cdata&action=info)

  * In other languages 

  * [ Español ](http://es.cppreference.com/w/cpp/ranges/cdata "cpp/ranges/cdata")
  * [ 日本語 ](http://ja.cppreference.com/w/cpp/ranges/cdata "cpp/ranges/cdata")
  * [ 中文 ](http://zh.cppreference.com/w/cpp/ranges/cdata "cpp/ranges/cdata")

  * This page was last modified on 8 September 2023, at 10:32. 
  * This page has been accessed 12,607 times. 

  * [ Privacy policy ](/w/Cppreference:Privacy_policy "Cppreference:Privacy policy")
  * [ About cppreference.com ](/w/Cppreference:About "Cppreference:About")
  * [ Disclaimers ](/w/Cppreference:General_disclaimer "Cppreference:General disclaimer")

  * [ ![Powered by MediaWiki](/mwiki/skins/common/images/poweredby_mediawiki_88x31.png) ](//www.mediawiki.org/) [ ![Powered by GeSHi](//upload.cppreference.com/mwiki/images/2/2b/powered_by_geshi_88x31.png) ](http://qbnz.com/highlighter/) [ ![Hosted by Tiger Technologies](//upload.cppreference.com/mwiki/images/9/94/powered_by_tigertech_88x31.png) ](http://www.tigertech.net/referral/cppreference.com)