<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B</id>
	<title>C++ - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=C%2B%2B"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=C%2B%2B&amp;action=history"/>
	<updated>2026-05-09T00:13:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=C%2B%2B&amp;diff=2574&amp;oldid=prev</id>
		<title>Kenneth at 20:41, 27 October 2015</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=C%2B%2B&amp;diff=2574&amp;oldid=prev"/>
		<updated>2015-10-27T20:41:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Convert String to Char ==&lt;br /&gt;
&lt;br /&gt;
 const char* string1 = str1.c_str();&lt;br /&gt;
&lt;br /&gt;
 std::string str;&lt;br /&gt;
 const char * c = str.c_str();&lt;br /&gt;
&lt;br /&gt;
 std::string str;&lt;br /&gt;
 char * writable = new char[str.size() + 1];&lt;br /&gt;
 std::copy(str.begin(), str.end(), writable);&lt;br /&gt;
 writable[str.size()] = &amp;#039;\0&amp;#039;; // don&amp;#039;t forget the terminating 0&lt;br /&gt;
 // do stuff ...&lt;br /&gt;
 // don&amp;#039;t forget to free the string after finished using it&lt;br /&gt;
 delete[] writable;&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* c++ - How to convert a std::string to const char* or char*? - Stack Overflow - http://stackoverflow.com/questions/347949/how-to-convert-a-stdstring-to-const-char-or-char&lt;br /&gt;
* c++ - std::string to char* - Stack Overflow - http://stackoverflow.com/questions/7352099/stdstring-to-char&lt;br /&gt;
&lt;br /&gt;
== keywords ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>