okay, I was wondering how to get rid of global variables.

For example, I have the following code:
Code:
int var1,var2,var3;  /* Global Vars, I want to get rid of */

int main()  {
  newfunc();  
  printf("The result is %d\n",var3");
}

int newfunc()  {
  int result; 
  result=var1+var2;   /*  <-THIS LINE! ->     */
  var3=result;
  return (0);
}
Basically, I want to send a pointer or address of integer var3 and the values of var1 and var2 to the function newfunc() and then be able to make changes to var3 without having to return the value to main(). Thanks.