<?xml-stylesheet type="text/xsl" href="http://redgloo.sse.reading.ac.uk/c4beginners/weblog/rss/rssstyles.xsl"?>
<rss version='2.0'   xmlns:dc='http://purl.org/dc/elements/1.1/'>
    <channel xml:base='http://redgloo.sse.reading.ac.uk/c4beginners/weblog/'>
        <title><![CDATA[C/C++ for Beginners : Weblog]]></title>
        <description><![CDATA[The weblog for C/C++ for Beginners, hosted on RedGloo.]]></description>
        <generator>Elgg</generator>
        <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/</link>        
        <item>
            <title><![CDATA[Removing Sub-strings]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/3057.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/3057.html</guid>
            <pubDate>Sun, 15 Mar 2009 23:13:44 GMT</pubDate>
		<dc:subject><![CDATA[removing sub-strings]]></dc:subject>
		<dc:subject><![CDATA[strings]]></dc:subject>
		<dc:subject><![CDATA[sub-strings]]></dc:subject>
		<dc:subject><![CDATA[deleting]]></dc:subject>
            <description><![CDATA[<p>I&#39;ve been trying to remove a smaller string that i know is contained within a larger string (eg. string1&lt;string2, where string1 is within string2). The following code I&#39;ve produced returns a pointer to a string. The function requires inputs of, a main string (string2) and the substring to be removed (string1). </p><p>The following code produces no errors, but a simple warning suggesting that I use strncpy_s (because its safer on windows). The program will crash after it has compiled and it doesn&#39;t say why. Here is my code:</p><p>char* delSubStr(char *string,char *target)</p><p>{</p><p>int i, index;</p><p>int sublen = strlen(target);</p><p>int strilen = strlen(string);</p><p>char *pos, *temp;</p><p>temp = (char *)calloc(sizeof(temp)+1, sizeof(temp));</p><p>pos = strstr(string,target);</p><p>index = string - pos;</p><p>while (pos!=NULL)</p><p>{</p><p><span class="Apple-tab-span"  style="white-space: pre">	</span>strncpy(temp,string,index);</p><p><span class="Apple-tab-span"  style="white-space: pre">	</span>for (i =(index+1); i &lt;=(strilen-1); i++)</p><p><span class="Apple-tab-span"  style="white-space: pre">	</span>{</p><p><span class="Apple-tab-span"  style="white-space: pre">		</span>temp[i] = string[i+sublen+1];</p><p><span class="Apple-tab-span"  style="white-space: pre">		</span>//strcpy((*string+i),*(string+i+1+sublen));</p><p><span class="Apple-tab-span"  style="white-space: pre">		</span>//string[i] = string[i+1+sublen];</p><p><span class="Apple-tab-span"  style="white-space: pre">	</span>}string = NULL;</p><p>}</p><p>return (temp);</p><p>&nbsp;</p><p>Can anyone suggest a better method that prevents overlap in sub-string deletion and another string pointer being made temporarily? some alternative methods I have tried withint the for-loop have been commented out. If they look more promising just say.&nbsp;</p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[Issue with arrays and strings]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/3045.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/3045.html</guid>
            <pubDate>Sat, 07 Mar 2009 01:08:55 GMT</pubDate>
		<dc:subject><![CDATA[arrays]]></dc:subject>
		<dc:subject><![CDATA[c]]></dc:subject>
		<dc:subject><![CDATA[pointers]]></dc:subject>
		<dc:subject><![CDATA[programming]]></dc:subject>
		<dc:subject><![CDATA[strings]]></dc:subject>
            <description><![CDATA[<p>Received from Scott Alexander:</p><p>&nbsp;</p><p>heya, I&#39;ve been having an issue with this bit of code</p><p>int FindKeywordInFile(){</p>int LoopCountOne; <p>int LoopCountTwo;</p>char Temp[KEYWORDLENGTH]; <p>char Text[RESPONSELENGTH];</p>char Converter[1]; <p>FILE *FilePointer;</p>FilePointer = fopen(&quot;JADEKEYWORDS.TXT&quot;,&quot;r&quot;); <p>&nbsp;</p><p>&nbsp;</p>if (FilePointer != NULL){while (fgets(Text,RESPONSELENGTH,FilePointer) !=NULL){ <p>&nbsp;</p><p>for (LoopCountOne = 0;LoopCountOne &lt;= 16; LoopCountOne ++){</p>for (LoopCountTwo = 0;LoopCountTwo &lt;= 20; LoopCountTwo ++){ <p>*Converter = WordArray[LoopCountOne][LoopCountTwo];</p><p>strcat(Temp,Converter);</p>printf(&quot;n%d.%c,%c,%s&quot;,LoopCountTwo,Converter[0],WordArray[LoopCountOne][LoopCountTwo],Temp); <p>}</p>strcpy(Temp,&quot; &quot;); <p>}</p><p>}</p><p>&nbsp;</p><p>}</p>return 0; <p>}</p><p>&nbsp;</p><p>the array WordArray[17][21] is global, the problem seems to be with the line strcat(Temp,Converter);&nbsp; If i /**/ it out the program works fine but with it in the program crashes as soon as it gets to it. Generaly the idea is that i&#39;ve got a 2d array where keywords have been seperated out and now i need to put them into a single variable one at a time so I can match the input word with a keyword stored in a file, if anyone can see how&nbsp;I can fix this or has another way round please let me know.<br /><br />Many Thanks</p><p>&nbsp;</p><p>Scott Alexander</p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[Objects Tutorial Code]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/3002.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/3002.html</guid>
            <pubDate>Wed, 11 Feb 2009 16:17:31 GMT</pubDate>
		<dc:subject><![CDATA[beginners]]></dc:subject>
		<dc:subject><![CDATA[tutorials]]></dc:subject>
		<dc:subject><![CDATA[objects]]></dc:subject>
		<dc:subject><![CDATA[object]]></dc:subject>
		<dc:subject><![CDATA[classes]]></dc:subject>
		<dc:subject><![CDATA[c++]]></dc:subject>
		<dc:subject><![CDATA[class]]></dc:subject>
            <description><![CDATA[<p>Please find the C++ code from today&#39;s tutorial <a href="http://redgloo.sse.reading.ac.uk/c4beginners/files/95"  title="Student Class">here</a>. Please add comments to your code as your understand the lines. Please feel free to post questions to this forum if you have any difficulties.</p><p>Please note: as you have not covered strings in C++ yet, these have not been included in this example. I will update the files when strings have been covered, either in lectures or in tutorials.&nbsp;</p><p><strong>Using the class in your main function:</strong></p><p>Read pages 9-11 (Term 2 Week 4 lecture 2)</p><p>Instantiate some objects with students (they do not have names yet, as strings are not used). Name the object after the student, then use the methods of the class to change some details. Then print the values of those objects.</p><p>For example:</p><p>sseStudent bob;</p><p>bob.setDegree(3);&nbsp;&nbsp;&nbsp; </p><p>/*using a code to represent the degree course - we haven&#39;t actually specified what code is for what course yet...*/</p><p>//we can use comments like this in C++</p><p>bob.setApplied(true);</p><p>cout &lt;&lt; &quot;Bob is on degree program &quot; &lt;&lt; bob.getDegree() &lt;&lt; &quot;.&quot; &lt;&lt; endl;</p><p>if(bob.isApplied())</p><p>{</p><p>&nbsp;&nbsp;&nbsp; cout &lt;&lt; &quot;Bob is on an applied course.&quot; &lt;&lt; endl;</p><p>} </p><p>Please ask for help if you need it. Feel free to expand the class or create your own examples of objects/classes - I&#39;m always appreciative of good ideas!&nbsp;</p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[Pointers]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2948.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2948.html</guid>
            <pubDate>Mon, 26 Jan 2009 21:54:35 GMT</pubDate>
		<dc:subject><![CDATA[beginners]]></dc:subject>
		<dc:subject><![CDATA[tutorials]]></dc:subject>
		<dc:subject><![CDATA[se1sa5]]></dc:subject>
		<dc:subject><![CDATA[Programming]]></dc:subject>
            <description><![CDATA[<p><a href="http://redgloo.sse.reading.ac.uk/c4beginners/files/-1/483/main.c"  target="_blank"  title="Pointers">http://redgloo.sse.reading.ac.uk/c4beginners/files/-1/483/main.c</a></p><p>Here are some examples of pointers used in the tutorials last week. Please ask any questions you need to on this board.</p><p>&nbsp;Andrew </p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[Christmas Exercises]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2899.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2899.html</guid>
            <pubDate>Tue, 23 Dec 2008 16:42:18 GMT</pubDate>
		<dc:subject><![CDATA[SE1SA5]]></dc:subject>
		<dc:subject><![CDATA[beginners]]></dc:subject>
		<dc:subject><![CDATA[c]]></dc:subject>
		<dc:subject><![CDATA[programming]]></dc:subject>
		<dc:subject><![CDATA[Beginners exercises]]></dc:subject>
            <description><![CDATA[<p>In addition to the exercises Giuseppe has provided on Blackboard, I have compiled a set of exercises designed to improve basic programming skills. These are aimed at beginner level. Therefore, attempt these knowing that everyone should be able to at least partially complete the harder tasks on Blackboard.</p><p><a href="http://redgloo.sse.reading.ac.uk/c4beginners/files/-1/475/Christmas+08+beginners+exercises.pdf"  target="_blank"  title="Christmas Exercises">http://redgloo.sse.reading.ac.uk/c4beginners/files/-1/475/Christmas+08+beginners+exercises.pdf </a></p><br />If these exercises prove to be useful, please let us know (under the post on RedGloo) and more will follow. If you have difficulty with any of the exercises, either from this list or from Blackboard, feel free to post your questions in this forum or hold your questions until the tutorials in the first week of term. If you have an answer that you would like someone to look at, you can e-mail me, attaching the .c file(s) (no .exe or others please) and I will aim to check them over and provide comments where necessary. Please remember that they are open to interpretation; if you feel you have completed the aims of the exercise and the program runs well, then you have probably succeeded. There will always be more than way to code the solutions and some will be better than others.<p>Thanks to Emma and Phil for their help. </p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[Online resources for C/C++ beginners]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2800.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2800.html</guid>
            <pubDate>Fri, 24 Oct 2008 09:44:48 GMT</pubDate>
            <description><![CDATA[<p>I was talking about collecting together various online resources to coincide with the book lists we get for our courses and somebody suggested I post the few links I had for C/C++ here, so here you go; </p><p><a href="http://www.freeprogrammingresources.com/cppbooks.html">http://www.freeprogrammingresources.com/cppbooks.html</a></p><p><a href="http://www.freeprogrammingresources.com/ctutor.html">http://www.freeprogrammingresources.com/ctutor.html</a></p><p>Contains a bunch of online books and tutorials on the matter.</p><p>So yeah, post your own links if you know of any good ones.</p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[Programming Challenges - Project Euler]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2798.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2798.html</guid>
            <pubDate>Thu, 23 Oct 2008 20:09:11 GMT</pubDate>
		<dc:subject><![CDATA[code coding programming beginners advanced euler project]]></dc:subject>
            <description><![CDATA[<p><a href="http://projecteuler.net/">http://projecteuler.net/</a></p><p>&nbsp;</p><p>Check it out - Suitable for beginners and advanced coders. </p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[C++ DLL]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2128.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2128.html</guid>
            <pubDate>Mon, 14 Jan 2008 08:42:30 GMT</pubDate>
		<dc:subject><![CDATA[c#]]></dc:subject>
		<dc:subject><![CDATA[dll]]></dc:subject>
		<dc:subject><![CDATA[c++]]></dc:subject>
            <description><![CDATA[<p>Does anyone know a handy tutorial on creating a .dll file to use c++ code in c#?</p><p>&nbsp;Thanks,</p><p>Jon&nbsp;</p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[Structs of Vectors inside Classes strange error]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2124.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/2124.html</guid>
            <pubDate>Thu, 10 Jan 2008 13:36:25 GMT</pubDate>
		<dc:subject><![CDATA[classes]]></dc:subject>
		<dc:subject><![CDATA[vector]]></dc:subject>
		<dc:subject><![CDATA[struct]]></dc:subject>
		<dc:subject><![CDATA[help]]></dc:subject>
		<dc:subject><![CDATA[error]]></dc:subject>
            <description><![CDATA[<p>While using vectors isn&#39;t the most efficient way of coding a neural network, it is certainly versatile. I&#39;m getting an error &quot;missing ; before &lt;&quot; on line 19 of filedata.h. I&#39;ve attached a screenshot of the revelant bits of the classes:</p><p> <a href="http://redgloo.sse.reading.ac.uk/siu06jp/files/-1/357/Code.png" ><img src="http://redgloo.sse.reading.ac.uk/_icon/file/357" alt="" /></a></p><p>&nbsp;Does anyone see what the trouble is?</p><p>&nbsp;*Above Problem Solved, new one below*</p><p>I fill the sets variable during the Network class constructor. It is declared in the Network.h file.</p><p>The contents are verified before the constructor returns.After it returns, sets is empty but the other class variables have the appropriate values</p><p><a href="http://redgloo.sse.reading.ac.uk/siu06jp/files/-1/358/Error.png" ><img src="http://redgloo.sse.reading.ac.uk/_icon/file/358" alt="" /></a> </p><p>Does anyone have any hints of what may cause this?&nbsp;</p>]]></description>
        </item>
                
        <item>
            <title><![CDATA[this-&gt;deZombify();]]></title>
            <link>http://redgloo.sse.reading.ac.uk/c4beginners/weblog/1873.html</link>
            <guid isPermaLink="true">http://redgloo.sse.reading.ac.uk/c4beginners/weblog/1873.html</guid>
            <pubDate>Tue, 23 Oct 2007 00:58:49 GMT</pubDate>
		<dc:subject><![CDATA[C]]></dc:subject>
		<dc:subject><![CDATA[C++]]></dc:subject>
		<dc:subject><![CDATA[First Year]]></dc:subject>
		<dc:subject><![CDATA[Practical]]></dc:subject>
		<dc:subject><![CDATA[Practicals]]></dc:subject>
		<dc:subject><![CDATA[Programming]]></dc:subject>
		<dc:subject><![CDATA[Programming Practicals]]></dc:subject>
		<dc:subject><![CDATA[SE1SA5]]></dc:subject>
            <description><![CDATA[<p>May I just suggest that, having just browsed through the community list looking for interesting ones, if you&#39;re First Year taking SE1SA5 you become a member of this community?</p><p>That way, if you&#39;re having great fun in your practicals, you can hop on here and help out and if you&#39;re finding that some things go over your head, you can post in here and get help from the (hopefully) friendly people who join. <img src="https://redgloo.sse.reading.ac.uk/_tinymce/jscripts/tiny_mce/plugins/emotions/images/smiley-laughing.gif"  border="0"  alt="Laughing"  title="Laughing"  width="18"  height="18" /></p>]]></description>
        </item>
        
    </channel>
</rss>