| dk274 (2) | |
|
im new to c++, and im having trouble with functions, can someone please explain to me and maybe provide a fix to this code. thanks beforehand. #include <iostream> #include <math.h> using namespace std; int main () { int pow(int, inr); cout<<"Please enter your first number"<<endl; cin>>firstnumber; cout<<"Please enter your second number"<<endl; cin>>secondnumber; power= pow(firstnumber,secondnumber) { int power (int x, int y); cout<<x<<endl; cout<<y<<endl; return power ; } system ("pause"); return 0; } | |
|
|
|
| dk274 (2) | |
| really need help | |
|
|
|
| Chervil (812) | |||
|
Your code seems a bit muddled. For one thing, it looks like an attempt to define one function inside another, that's not possible. This is a general idea of how it might look, though I've not attempted to use your example.
| |||
|
|
|||