<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Thu Jun 20, 2013 2:32 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Thu Jun 20, 2013 2:32 am</pubDate>
  <lastBuildDate>Thu Jun 20, 2013 2:32 am</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Solved!</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=103838#103838</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66284'&gt;stuarte9&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Fri Jan 13, 2012 2:27 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi all,&lt;br /&gt;
&lt;br /&gt;
Just a quick note to say I've now solved the problem outlined in my original posting. It boiled down to not putting an ampersand (&amp;amp;) at the beginning of variable &amp;quot;theMatrix&amp;quot; in the function header.&lt;br /&gt;
&lt;br /&gt;
Stuart</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=103838#103838</comments>
                                        <author>stuarte9</author>
                                        <pubDate>Fri Jan 13, 2012 2:27 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=103838#103838</guid>
                                      </item>
                                      <item>
                                        <title>Need help with a segmentation fault</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=103831#103831</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=66284'&gt;stuarte9&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Jan 12, 2012 2:37 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi all,&lt;br /&gt;
&lt;br /&gt;
I'm teaching myself C++ and getting a segmentation fault with my latest small prog. The fault occurs within the following function, at the &amp;quot;std::cin&amp;quot; statement.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;void getValues&amp;#40;int** theMatrix, int&amp;amp; theRows, int&amp;amp; theColumns&amp;#41;&lt;br /&gt;
&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;for &amp;#40;int row = 0; row &amp;lt; theRows; ++row&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;// prompt for values&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;std&amp;#58;&amp;#58;cout &amp;lt;&amp;lt; std&amp;#58;&amp;#58;endl &amp;lt;&amp;lt; &amp;quot;Enter values for row &amp;quot; &amp;lt;&amp;lt; &amp;#40;row + 1&amp;#41; &amp;lt;&amp;lt; std&amp;#58;&amp;#58;endl;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;// and then use a for loop to assign values from cin&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;for &amp;#40;int column = 0; column &amp;lt; theColumns; ++column&amp;#41;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;#123;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;std&amp;#58;&amp;#58;cin &amp;gt;&amp;gt; theMatrix&amp;#91;row&amp;#93;&amp;#91;column&amp;#93;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;#125;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;#125;&lt;br /&gt;
&amp;#125;&lt;br /&gt;
&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
The intention of this function is to prompt for and read integer values into a 2D array.&lt;br /&gt;
&lt;br /&gt;
Could someone please explain why I'm getting this fault as everything seems OK to me.&lt;br /&gt;
&lt;br /&gt;
Thanks in advance,&lt;br /&gt;
&lt;br /&gt;
Stuart</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=103831#103831</comments>
                                        <author>stuarte9</author>
                                        <pubDate>Thu Jan 12, 2012 2:37 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=103831#103831</guid>
                                      </item></channel></rss>