<?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>Reddit | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/tag/reddit/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, 05 Oct 2020 08:12:53 +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>Reddit | 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>Discussing the use of break in C</title>
		<link>https://learncgames.com/discussing-the-use-of-break-in-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=discussing-the-use-of-break-in-c</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 06 Oct 2020 23:00:47 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[break]]></category>
		<category><![CDATA[Reddit]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1541</guid>

					<description><![CDATA[<p>On the C programming subreddit there&#8217;s a discussion where a student has been old he should never use break in C. As one comment says, &#8220;The teacher is a nitwit&#8221; and I agree with that comment. I use break (a) to exit loops early and (b) to exit every branch of a switch statement unless [&#8230;]</p>
The post <a href="https://learncgames.com/discussing-the-use-of-break-in-c/">Discussing the use of break in C</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;:469,&quot;href&quot;:&quot;https:\/\/pixabay.com\/users\/pramit_marattha-3815284\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1896903&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:470,&quot;href&quot;:&quot;https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1896903&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 15:15:37&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-10 05:52:35&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-15 02:54:44&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-22 21:10:52&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-08 09:19:59&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-13 14:16:18&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-21 10:52:19&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 10:52:19&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:471,&quot;href&quot;:&quot;https:\/\/www.reddit.com\/r\/C_Programming\/comments\/j50g9a\/why_should_i_avoid_break&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20241203175415\/https:\/\/www.reddit.com\/r\/C_Programming\/comments\/j50g9a\/why_should_i_avoid_break\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 15:15:39&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-10 05:52:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-15 02:54:44&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-22 21:10:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-08 09:20:00&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-13 14:16:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-21 10:52:19&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 10:52:19&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_1543" aria-describedby="caption-attachment-1543" style="width: 239px" class="wp-caption alignleft"><img fetchpriority="high" decoding="async" class="size-medium wp-image-1543" src="https://learncgames.com/wp-content/uploads/2020/10/alphabet-1896903_640-239x300.png" alt="C" width="239" height="300" srcset="https://learncgames.com/wp-content/uploads/2020/10/alphabet-1896903_640-239x300.png 239w, https://learncgames.com/wp-content/uploads/2020/10/alphabet-1896903_640.png 509w" sizes="(max-width: 239px) 100vw, 239px" /><figcaption id="caption-attachment-1543" class="wp-caption-text">Image by <a href="https://pixabay.com/users/pramit_marattha-3815284/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1896903">pramit marattha</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1896903">Pixabay</a></figcaption></figure>
<p>On the C programming subreddit <a title="Link to subreddit discussion on break" href="https://www.reddit.com/r/C_Programming/comments/j50g9a/why_should_i_avoid_break/" target="_blank" rel="nofollow noopener noreferrer">there&#8217;s a discussion</a> where a student has been old he should never use break in C. As one comment says, &#8220;The teacher is a nitwit&#8221; and I agree with that comment.</p>
<p>I use break <strong>(a) to exit loops early</strong> and <strong>(b) to exit every branch of a switch statement</strong> unless I want it to drop through or else that case does a return. I use switch a few times in the asteroids source code and there&#8217;s examples of all three instances of using breaks, using returns and dropping through cases (no break).</p>
<p>Here&#8217;s an example of the latter. It controls the logic of what to display when you start or restart a level after losing lose a life. If you have one life left it prints &#8220;Last life&#8221; otherwise it prints how many you&#8217;ve got. Actually I think it&#8217;s a bit of an overkill and an <strong>if else</strong> would have done just as well</p>
<p>&nbsp;</p>
<pre><code class="language-c" data-line="">	switch (Player.lives) {
		case 1:sprintf_s(buffer, sizeof(buffer), &quot;Last Life!&quot;);
			break;
		case 2:
		case 3:sprintf_s(buffer, sizeof(buffer), &quot;Lives left: %d&quot;, Player.lives);
			break;
		}</code></pre>
<p>So probably not the best example of using a switch! But it illustrates a point.</p>The post <a href="https://learncgames.com/discussing-the-use-of-break-in-c/">Discussing the use of break in C</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">1541</post-id>	</item>
		<item>
		<title>Where do I get a lot of my information from?</title>
		<link>https://learncgames.com/where-do-i-get-a-lot-of-my-information-from/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=where-do-i-get-a-lot-of-my-information-from</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Thu, 01 Oct 2020 23:00:01 +0000</pubDate>
				<category><![CDATA[resources]]></category>
		<category><![CDATA[Reddit]]></category>
		<category><![CDATA[subreddits]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1516</guid>

					<description><![CDATA[<p>I was asked this a few months ago. There are various sources including Hackers News and Reddit.com. But reddit is just a collection of specialised sub communities (known as Subreddits) and even I wasn&#8217;t aware of quite how many there are. I came across a link which lists 43 programming related subreddits. On the right [&#8230;]</p>
The post <a href="https://learncgames.com/where-do-i-get-a-lot-of-my-information-from/">Where do I get a lot of my information from?</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;:487,&quot;href&quot;:&quot;https:\/\/www.reddit.com\/user\/mawburn\/m\/techsubs&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20250725224510\/https:\/\/www.reddit.com\/user\/mawburn\/m\/techsubs\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 15:25:41&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-11 20:03:12&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-21 08:28:47&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-27 11:03:33&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-03 13:12:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-09 14:32:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-14 23:03:25&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-26 02:51:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 11:56:14&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-05 07:29:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-11 02:40:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-15 16:48:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 21:30:14&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-18 21:30:14&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img decoding="async" class="alignleft size-full wp-image-1517" src="https://learncgames.com/wp-content/uploads/2020/09/subreddits.png" alt="Subreddits" width="694" height="684" srcset="https://learncgames.com/wp-content/uploads/2020/09/subreddits.png 694w, https://learncgames.com/wp-content/uploads/2020/09/subreddits-300x296.png 300w" sizes="(max-width: 694px) 100vw, 694px" />I was asked this a few months ago. There are various sources including Hackers News and Reddit.com. But reddit is just a collection of specialised sub communities (<em>known as Subreddits)</em> and even I wasn&#8217;t aware of quite how many there are.</p>
<p>I came across a link which <a title="Link to techsubs on reddit.com" href="https://www.reddit.com/user/mawburn/m/techsubs" target="_blank" rel="nofollow noopener noreferrer">lists 43 programming related subreddits</a>. On the right hand bar there&#8217; a list of a few Subreddits but at the bottom there&#8217;s a <strong>View More</strong> link to show all 43.</p>
<p>I&#8217;ve shown them here to give you an idea of what&#8217;s available. The member numbers will change and are often out of date anyway.</p>The post <a href="https://learncgames.com/where-do-i-get-a-lot-of-my-information-from/">Where do I get a lot of my information from?</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">1516</post-id>	</item>
	</channel>
</rss>
