Changing the value of a variable in main to be available for other functions (c++)
<p>I declare this:</p>

<pre><code>int xstartoftable;
void drawframe();

int main()
{
   int xstartoftable = 80-TLENGTH;
   drawframe();

   return 0
}
void drawframe();
{
   gotoXY(xstartoftable - 1, ystartoftable - 1);
}
</code></pre>

<p>The problem is that when I debug, the value of xstartoftable is random, not equal to the one in the main(). The code is over 150 lines, this is just the parts that are needed.</p>
