Quote:
Originally Posted by
Diablo667
Your problem is withing function:
Code:
void getNum(int *x, int *y)
{
printf("Enter num1=");
scanf("%d", *x); it should look like this : scanf("%d", x);
printf("Enter num2=");
scanf("%d", *y); scanf("%d", *y);
}
Hi,
Thanks a lot for the suggestion, though this solved the problem I was having but I am still doubtful why did it worked, as *var refers value at the address stored in <var>, while var stores the address of the another integer variable.
Please correct me if I am wrong, thanks :)