<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>malloc | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/tag/malloc/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Mon, 01 Feb 2021 20:22:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>malloc | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>C Tutorial thirteen published on allocating memory</title>
		<link>https://learncgames.com/c-tutorial-thirteen-published-on-allocating-memory/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=c-tutorial-thirteen-published-on-allocating-memory</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 02 Feb 2021 00:00:11 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[calloc]]></category>
		<category><![CDATA[malloc]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2590</guid>

					<description><![CDATA[<p>I&#8217;ve restricted this tutorial to using malloc as it&#8217;s the main way you allocate and use dynamic memory in the thirteenth tutorial. Pointers hold an address (of somewhere in RAM) and this can be an existing variable, a function or even data like a text string. But if you want to reserve a block of [&#8230;]</p>
The post <a href="https://learncgames.com/c-tutorial-thirteen-published-on-allocating-memory/">C Tutorial thirteen published on allocating memory</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:208,&quot;href&quot;:&quot;https:\/\/pixabay.com\/users\/publicdomainpictures-14\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=20072&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260201001249\/https:\/\/pixabay.com\/users\/publicdomainpictures-14\/?utm_source=link-attribution&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 12:45:21&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-11 15:44:45&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-24 20:13:13&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-28 14:18:58&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-05 05:31:29&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-09 12:22:29&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-14 23:28:57&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-24 21:49:11&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-30 15:12:30&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 14:00:52&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-15 09:29:34&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-15 09:29:34&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:209,&quot;href&quot;:&quot;https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=20072&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260205102120\/https:\/\/pixabay.com\/?utm_source=link-attribution&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 12:45:23&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-11 15:44:45&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-24 20:13:13&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-28 14:18:57&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-05 05:31:29&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-09 12:22:27&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-14 23:28:58&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-24 21:49:04&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-30 15:12:30&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 14:00:52&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-15 09:29:34&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-15 09:29:34&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_2591" aria-describedby="caption-attachment-2591" style="width: 300px" class="wp-caption alignleft"><img fetchpriority="high" decoding="async" class="size-medium wp-image-2591" src="https://learncgames.com/wp-content/uploads/2021/02/chips-20072_640-300x200.jpg" alt="Memory chips" width="300" height="200" srcset="https://learncgames.com/wp-content/uploads/2021/02/chips-20072_640-300x200.jpg 300w, https://learncgames.com/wp-content/uploads/2021/02/chips-20072_640.jpg 640w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-2591" class="wp-caption-text">Image by <a href="https://pixabay.com/users/publicdomainpictures-14/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=20072">PublicDomainPictures</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=20072">Pixabay</a></figcaption></figure>
<p>I&#8217;ve restricted this tutorial to using <strong>malloc</strong> as it&#8217;s the main way you allocate and use dynamic memory in the <a title="Link to C tutorial thirteen on allocating memory" href="https://learncgames.com/tutorial-thirteen-allocating-memory-in-c/" target="_blank" rel="nofollow noopener">thirteenth tutorial</a>.</p>
<p>Pointers hold an address (<em>of somewhere in RAM</em>) and this can be an existing variable, a function or even data like a text string. But if you want to reserve a block of RAM and get a pointer to it, you have to call the stdlib function <strong>malloc()</strong>. (<em>Or <strong>calloc</strong>, but I will return to that in a future tutoria</em>l).</p>
<p>Of course once you&#8217;ve finished using a block of RAM, it&#8217;s only polite to return it to the operating system by calling <strong>free(). </strong>Don&#8217;t forget either that <strong>malloc</strong> always returns a void * pointer, so you should cast it to something appropriate.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/c-tutorial-thirteen-published-on-allocating-memory/">C Tutorial thirteen published on allocating memory</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2590</post-id>	</item>
	</channel>
</rss>
