[#boost-urls-url_base-c_str]
= xref:boost/urls/url_base/c_str.adoc[boost::urls::url&lowbar;base::c&lowbar;str]
:relfileprefix: ../../../
:mrdocs:

Return the url as a null&hyphen;terminated string

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L128[boost&sol;url&sol;url&lowbar;base&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
char const*
c&lowbar;str() const noexcept;
----

== Description

This function returns a pointer to a null terminated string representing the url, which may contain percent escapes&period;

== Example
[,cpp]
----
assert( std::strlen( url( "http://www.example.com" ).c_str() ) == 22 );
----
== Complexity
Constant&period;

== Exception Safety
Throws nothing&period;

== Return Value

A pointer to a null&hyphen;terminated string containing the URL&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
