<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Code Break' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Code Break' posted on the 'Beginner C/C++' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 01:35:15 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 01:35:15 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Code Break</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/369825/369825/code-break/</link>
      <description>My code breaks at this point &amp;lt;in red&amp;gt;. Any suggestions?&lt;br /&gt;
&lt;br /&gt;
int compare (const void * a, const void * b)&lt;br /&gt;
{&lt;br /&gt;
  &lt;span style="color: Red;"&gt;return ( *(float*)a - *(float*)b );&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
float Calc_Median(int intArraySize)&lt;br /&gt;
{&lt;br /&gt;
int n;&lt;br /&gt;
  qsort (CalcTimeArray, intArraySize, sizeof(float), compare);&lt;br /&gt;
  for (n=0; n&amp;lt;intArraySize; n++)&lt;br /&gt;
     printf ("%d ",CalcTimeArray[n]);&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/369825/369825/code-break/</guid>
      <pubDate>Mon, 25 Feb 2008 19:51:54 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Code Break</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/369825/369829/re-code-break/#369829</link>
      <description>: My code breaks at this point &amp;lt;in red&amp;gt;. Any suggestions?&lt;br /&gt;
: &lt;br /&gt;
: int compare (const void * a, const void * b)&lt;br /&gt;
: {&lt;br /&gt;
:   &lt;span style="color: Red;"&gt;return ( *(float*)a - *(float*)b );&lt;br /&gt;
: }&lt;/span&gt;&lt;br /&gt;
: &lt;br /&gt;
: float Calc_Median(int intArraySize)&lt;br /&gt;
: {&lt;br /&gt;
: int n;&lt;br /&gt;
:   qsort (CalcTimeArray, intArraySize, sizeof(float), compare);&lt;br /&gt;
:   for (n=0; n&amp;lt;intArraySize; n++)&lt;br /&gt;
:      printf ("%d ",CalcTimeArray[n]);&lt;br /&gt;
:   return 0;&lt;br /&gt;
: }&lt;br /&gt;
: &lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;br /&gt;
What's "code breaks"?&lt;br /&gt;
1. Code does not compile&lt;br /&gt;
2. Code does not run&lt;br /&gt;
&lt;/span&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/369825/369829/re-code-break/#369829</guid>
      <pubDate>Mon, 25 Feb 2008 20:50:03 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Code Break</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/369825/369844/re-code-break/#369844</link>
      <description>: : My code breaks at this point &amp;lt;in red&amp;gt;. Any suggestions?&lt;br /&gt;
: : &lt;br /&gt;
: : int compare (const void * a, const void * b)&lt;br /&gt;
: : {&lt;br /&gt;
: :   &lt;span style="color: Red;"&gt;return ( *(float*)a - *(float*)b );&lt;br /&gt;
: : }&lt;/span&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : float Calc_Median(int intArraySize)&lt;br /&gt;
: : {&lt;br /&gt;
: : int n;&lt;br /&gt;
: :   qsort (CalcTimeArray, intArraySize, sizeof(float), compare);&lt;br /&gt;
: :   for (n=0; n&amp;lt;intArraySize; n++)&lt;br /&gt;
: :      printf ("%d ",CalcTimeArray[n]);&lt;br /&gt;
: :   return 0;&lt;br /&gt;
: : }&lt;br /&gt;
: : &lt;br /&gt;
: &lt;span style="color: Blue;"&gt;&lt;br /&gt;
: What's "code breaks"?&lt;br /&gt;
: 1. Code does not compile&lt;br /&gt;
: 2. Code does not run&lt;br /&gt;
: &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Code doesn't run. I put break points and stepped thru. Then the code does do anything when it gets to the return (* (float* ........&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/369825/369844/re-code-break/#369844</guid>
      <pubDate>Tue, 26 Feb 2008 06:56:35 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Code Break</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/369825/369846/re-code-break/#369846</link>
      <description>Since you didn't post what type of variables you put into qsort, the question is impossible to answer. There is no error in that code. (Except it is non-portable, but that might not be an issue here)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/369825/369846/re-code-break/#369846</guid>
      <pubDate>Tue, 26 Feb 2008 09:03:36 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Code Break</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/369825/369849/re-code-break/#369849</link>
      <description>: Since you didn't post what type of variables you put into qsort, the &lt;br /&gt;
: question is impossible to answer. There is no error in that code. &lt;br /&gt;
: (Except it is non-portable, but that might not be an issue here)&lt;br /&gt;
&lt;br /&gt;
Figured out that it didn't like using "float" but did fine with the "int". I went to using a vector class. Works the way I want it to.&lt;br /&gt;
&lt;br /&gt;
Thanks....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/369825/369849/re-code-break/#369849</guid>
      <pubDate>Tue, 26 Feb 2008 11:16:07 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: Code Break</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/369825/369916/re-code-break/#369916</link>
      <description>: : Since you didn't post what type of variables you put into qsort, the &lt;br /&gt;
: : question is impossible to answer. There is no error in that code. &lt;br /&gt;
: : (Except it is non-portable, but that might not be an issue here)&lt;br /&gt;
: &lt;br /&gt;
: Figured out that it didn't like using "float" but did fine with the &lt;br /&gt;
: "int". I went to using a vector class. Works the way I want it to.&lt;br /&gt;
: &lt;br /&gt;
: Thanks....&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
Hmm, on that note I thought I would contribute a reason. Type casting it to float means that it would use floating point arithmatic. Which simply doesn't make sense to use in that context. For example thinking of floating point arithmatic in terms of scientific notation, they are very similar:&lt;br /&gt;
&lt;br /&gt;
if you go &lt;br /&gt;
&lt;br /&gt;
1.45E-1 + 4.00E-1 you get 5.45E-1 but if you add 1.34E0 and 5.00E-1 you get  1.84E0 which is represented you completely different in terms of binary than the sum of each direct number.&lt;br /&gt;
&lt;br /&gt;
Aye aye aye.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/369825/369916/re-code-break/#369916</guid>
      <pubDate>Thu, 28 Feb 2008 21:14:48 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
  </channel>
</rss>