MCPcopy Create free account
hub / github.com/0voice/cpp_new_features / main

Function main

cpp_17/012_stl_data.cpp:5–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <iostream>
4
5int main()
6{
7 std::string s {"Hello world!\n"};
8
9 char a[20]; // storage for a C-style string
10 std::strcpy(a, std::data(s));
11 // [s.data(), s.data() + s.size()] is guaranteed to be an NTBS since C++11
12
13 std::cout << a;
14}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected