Help with pow() functions or functions in general..

Hey!

Can someone please help me with this one. Why dosen't this code compile? I've obviously problem with understanding the prototype function declaration thingy.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "stdafx.h"
#include <iostream>
#include <cmath>

using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
	double x;
	double y;
	x = 50;
	y = 60;

	double answer;
	
	double pow(double, double);
	answer = pow(x, y);

	cout << "Hey, you know that, " << answer << " are some numbers..." << endl;

	cin.get();

	return 0;
}


What's missing?

Thanks in advance! :>
Last edited on
<cmath> declares function 'pow'. Therefore, you should not do it, particularly inside main. If you do declare your own 'pow', then you must provide an implementation for it too.

"Does not compile" ... compiler does tell why it does not like something. Compiler can be awfully verbose at times, but at least try to look at its output for hints.
Could you please write down the code so it's working and so I can see it? Since i'm retarded and don't really understand what you are saying...

I accualty did look at the output but it went over my head. I think there's something that i've missed with the prototype function. Got to read more about that..
Last edited on
Remove line 17.
I'm pretty sure that i tried that before and it didn't work... Oh well it worked now xD. Thanks man
Topic archived. No new replies allowed.