i dont know how to pass variable values from a function to another..
i get this error passing arg 1of 'add' makes integer from pointer without a cast
here is my complete code:
(this is not complete as i am just starting a text-only calculator :P)
#include <stdio.h>
void main(void)
{
int iInput;
char ops;
printf ("First number:\n");
scanf ("%i", &iInput);
op(&iInput);
}
int op(int a)
{
int choice;
printf ("%i\n",a);
printf ("What operation?\n1 for addition\n2 for subtraction\n3 for multiplication\n4 for division\n");
scanf ("%i", &choice);
if (choice == 1)
{
printf ("%i\n",a);
add(&a);
}
else
if (choice == 2)
{
}
else
if (choice == 3)
{
}
else
if (choice == 4)
{
}
}
int add(int a)
{
printf ("%i",a);
}
int sub()
{
}
int mul()
{
}
int div()
{
}