Passing by pointer, cannot convert argument 1 from int* to int

I cannot get passing by pointer to work in visual studio. Here is a simple example. Somebody tell me what I am doing wrong. I get the error "cannot convert argument 1 from 'int*' to 'int'


#include <iostream>
using namespace std;

void GetFraction(int numer, int denom);

int main()
{
int numer = 0, denom = 0;

GetFraction(&numer, &denom); // Pass by pointer

cout << numer << '/' << denom << endl;

return 0;
}
void GetFraction(int * numer, int * denom)
{
cout << "Enter numerator: ";
cin >> *numer;

cout << "Enter denominator: ";
cin >> *denom;
}
Prototype void GetFraction(int numer, int denom); doesn't match definition void GetFraction(int * numer, int * denom)
Your function prototype doesnt match your function definition.
....I am so stupid. Thanks
Topic archived. No new replies allowed.