<?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>strings | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/tag/strings/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>Sat, 06 Feb 2021 19:43:44 +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>strings | 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>Tutorial 14 on working with strings published</title>
		<link>https://learncgames.com/tutorial-14-on-working-with-strings-published/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tutorial-14-on-working-with-strings-published</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 07 Feb 2021 00:00:05 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[strings]]></category>
		<category><![CDATA[text]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2630</guid>

					<description><![CDATA[<p>Reading the C reddit most days, I see from time to time question about strings. They&#8217;re not particularly complex but I feel you really have to get your head around pointers to grok strings. I&#8217;ve already done a C tutorial on Pointers and c-strings but I thought showing some examples of doing things with c-strings [&#8230;]</p>
The post <a href="https://learncgames.com/tutorial-14-on-working-with-strings-published/">Tutorial 14 on working with strings published</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;:196,&quot;href&quot;:&quot;https:\/\/pixabay.com\/users\/markusspiske-670330\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1568556&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;:197,&quot;href&quot;:&quot;https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1568556&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:33:05&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-11 15:44:44&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-19 10:48:59&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-22 20:14:49&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-27 12:27:02&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-08 11:33:28&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-13 10:15:23&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-24 21:49:14&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-12 02:38:36&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-15 09:29:25&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-15 09:29:25&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:157,&quot;href&quot;:&quot;https:\/\/www.reddit.com\/r\/C_Programming&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;}]'></div>
<figure id="attachment_2631" aria-describedby="caption-attachment-2631" style="width: 200px" class="wp-caption alignleft"><img fetchpriority="high" decoding="async" class="size-medium wp-image-2631" src="https://learncgames.com/wp-content/uploads/2021/02/code-1568556_640-200x300.jpg" alt="Code listing on screen with keyboard" width="200" height="300" srcset="https://learncgames.com/wp-content/uploads/2021/02/code-1568556_640-200x300.jpg 200w, https://learncgames.com/wp-content/uploads/2021/02/code-1568556_640.jpg 426w" sizes="(max-width: 200px) 100vw, 200px" /><figcaption id="caption-attachment-2631" class="wp-caption-text">Image by <a href="https://pixabay.com/users/markusspiske-670330/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1568556">Markus Spiske</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1568556">Pixabay</a></figcaption></figure>
<p>Reading the <a title="Link to C Subreddit" href="https://www.reddit.com/r/C_Programming/" target="_blank" rel="nofollow noopener">C reddit</a> most days, I see from time to time question about strings. They&#8217;re not particularly complex but I feel you really have to get your head around pointers to grok strings. I&#8217;ve already done a C tutorial on <a title="Link to tutorial on pointers and C-Strings" href="https://learncgames.com/tutorial-seven-about-pointers-and-strings/" target="_blank" rel="nofollow noopener">Pointers and c-strings</a> but I thought showing some examples of doing things with c-strings would not go amiss.</p>
<p>The pointers aspect of C strings probably muddies the water a bit. All you are doing is manipulating a contiguous block of characters in RAM that ends with a 0. The pointer just tells you where in RAM that block begins. So long as it finishes with a 0 (\0 in C), it will work ok.</p>
<p>That&#8217;s what <a title="Tutorial 14 – Working with strings in C" href="https://learncgames.com/tutorials/tutorial-14-working-with-strings-in-c/" target="_blank" rel="nofollow noopener">Tutorial 14- working with strings</a> is about.  Especially for beginners, doing things like converting ints to strings, or concatenating strings can be a bit fiddly. I&#8217;ve also provided both the Windows and Linux versions. i.e. compiling with Visual C on Windows and clang on Ubuntu.</p>
<p>For instance, you might have heard about the long to ascii function <strong>ltoa</strong>. Bad news. It doesn&#8217;t exist in Linux compilers.  There is a Windows version with the instantly memorable (not) name <strong>_ltoa_s</strong>, which is one of the safe C functions.  Incidentally if you are using SDL then there is a <strong>SDL_ltoa</strong> function provided for you although oddly it&#8217;s not documented.</p>The post <a href="https://learncgames.com/tutorial-14-on-working-with-strings-published/">Tutorial 14 on working with strings published</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">2630</post-id>	</item>
		<item>
		<title>Improving on C strings</title>
		<link>https://learncgames.com/improving-on-c-strings/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=improving-on-c-strings</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 28 Jul 2020 23:00:56 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[strings]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1067</guid>

					<description><![CDATA[<p>Although C has many useful features, Text or string handling is not one of them. Unless you are writing text adventures, this is probably not a big deal and even games like Asteroids do write text messages, show the score etc. Givn C&#8217;s age, it&#8217;s not surprising that people have tried to improve on C&#8217;s [&#8230;]</p>
The post <a href="https://learncgames.com/improving-on-c-strings/">Improving on C strings</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;:604,&quot;href&quot;:&quot;https:\/\/pixabay.com\/users\/cocoparisienne-127419\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2956789&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;:605,&quot;href&quot;:&quot;https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2956789&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;:606,&quot;href&quot;:&quot;http:\/\/bstring.sourceforge.net&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260112041150\/https:\/\/bstring.sourceforge.net\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 16:39:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 13:54:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-22 05:50:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 12:29:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-04 18:50:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 05:20:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-28 11:34:21&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 09:11:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-05 11:19:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 20:30:20&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-17 17:47:25&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-17 17:47:25&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_1071" aria-describedby="caption-attachment-1071" style="width: 300px" class="wp-caption alignleft"><img decoding="async" class="size-medium wp-image-1071" src="https://learncgames.com/wp-content/uploads/2020/07/background-2956789_640-300x184.jpg" alt="T" width="300" height="184" srcset="https://learncgames.com/wp-content/uploads/2020/07/background-2956789_640-300x184.jpg 300w, https://learncgames.com/wp-content/uploads/2020/07/background-2956789_640.jpg 640w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-1071" class="wp-caption-text">Image by <a href="https://pixabay.com/users/cocoparisienne-127419/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2956789">Anja<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f917.png" alt="🤗" class="wp-smiley" style="height: 1em; max-height: 1em;" />#helpinghands #solidarity#stays healthy<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" /></a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2956789">Pixabay</a></figcaption></figure>
<p>Although C has many useful features, Text or string handling is not one of them. Unless you are writing text adventures, this is probably not a big deal and even games like Asteroids do write text messages, show the score etc.</p>
<p>Givn C&#8217;s age, it&#8217;s not surprising that people have tried to improve on C&#8217;s strings (char *) and one that I came across is the <a title="Link to Better String Library" href="http://bstring.sourceforge.net/" target="_blank" rel="noopener noreferrer">Better string library</a>. The library is stand alone, portable and known to work with gcc/g++, MSVC++, Intel C++, WATCOM C/C++, Turbo C, Borland C++, IBM&#8217;s native CC compiler on Windows, Linux and Mac OS X. If you are bothered by buffer overflow type bugs, this is one area that BSL can definitely improve on. Note although the main documentation is just one text file, it is a very long file!</p>
<p>I haven&#8217;t tested it with clang but if it works with gcc the odds are it will work with clang.</p>
<p>I&#8217;ve added it to the C code links page.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/improving-on-c-strings/">Improving on C strings</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">1067</post-id>	</item>
	</channel>
</rss>
