<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'function call help' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'function call help' posted on the 'Beginner C/C++' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 13:16:49 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 13:16:49 -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>function call help</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/410430/410430/function-call-help/</link>
      <description>The question asks for two numbers to be entered and the first number is to be raised to the power of the second number entered. The problem I am having is when I go to compile my program I get a logic error, and when I include the actual function in my function call the program will not compile and give me the error: ambiguous call to overloaded function. Any help that can be given is and will be greatly appreciated. Here is my code with the pow() function included in the function call:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;cmath&amp;gt;
using namespace std;

void powfun(long x, long y); 

int main()
{
	long firstnum, secnum;
	cout &amp;lt;&amp;lt; "\nPlease enter a positive integer: ";
	cin &amp;gt;&amp;gt; firstnum;
	cout &amp;lt;&amp;lt; "\nGreat! Now please enter a second positive integer: ";
	cin &amp;gt;&amp;gt; secnum;
	powfun(firstnum, secnum);
	system ("pause");
	return 0;
}
void powfun(long x, long y)
{
	long result;
	result = pow(x, y);
	cout &amp;lt;&amp;lt; "\nThe answer is: " &amp;lt;&amp;lt; result &amp;lt;&amp;lt; endl;
	return;
}&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/410430/410430/function-call-help/</guid>
      <pubDate>Sun, 06 Dec 2009 23:24:38 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: function call help</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/410430/410446/re-function-call-help/#410446</link>
      <description>&lt;span style="color: Blue;"&gt;Please post the error message itself.&lt;/span&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/410430/410446/re-function-call-help/#410446</guid>
      <pubDate>Mon, 07 Dec 2009 05:13:06 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: function call help</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/410430/410464/re-function-call-help/#410464</link>
      <description>error C2268:'pow': ambiguous call to overloaded function &lt;br /&gt;
that's what comes up with the pow() in the function call with out the pow() the program will run but it will stop once I enter the two numbers and give me this message: Run-Time Check Failure #3 - The variable 'result' is being used without being initialized. and the result I get from what is supposed to be 2 to the 2nd power is -858993460 I hope this helps get you guys the info needed to help me figure this out.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/410430/410464/re-function-call-help/#410464</guid>
      <pubDate>Mon, 07 Dec 2009 11:21:40 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: function call help</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/410430/410476/re-function-call-help/#410476</link>
      <description>The problem was that the pow function overloaded. try changing the long variables (long firstnum, secnum) to double firstnum, secnum. that should do the trick, laptop running out of battery, just change that and it should work. good luck&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/410430/410476/re-function-call-help/#410476</guid>
      <pubDate>Mon, 07 Dec 2009 20:45:05 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: function call help</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/410430/410490/re-function-call-help/#410490</link>
      <description>I figured it out turns out where I had x and y in the function call I needed to have the variables that I declared in the main(). Anyways, thanks for all the help that was given it was greatly appreciated.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/410430/410490/re-function-call-help/#410490</guid>
      <pubDate>Tue, 08 Dec 2009 03:17:58 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: function call help</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/410430/411326/re-function-call-help/#411326</link>
      <description>hi&lt;br /&gt;
this is manjunath!!!&lt;br /&gt;
i tried ur code on my turbo compiler.i truncated that system("pause")part and was able to get result!!&lt;br /&gt;
i don find prob in ur code.its correct!!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/410430/411326/re-function-call-help/#411326</guid>
      <pubDate>Mon, 28 Dec 2009 22:57:38 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
    <item>
      <title>Re: function call help</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/410430/411327/re-function-call-help/#411327</link>
      <description>hi&lt;br /&gt;
this is manjunath!!!&lt;br /&gt;
i tried ur code on my turbo compiler.i truncated that system("pause")part and was able to get result!!&lt;br /&gt;
i don find prob in ur code.its correct!!</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/410430/411327/re-function-call-help/#411327</guid>
      <pubDate>Mon, 28 Dec 2009 22:59:26 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
  </channel>
</rss>
