Can someone help me edit this program. I am a begginer in C and suck at it somewhat. I can't figure out a way to make the function work since i have to initialize s to equal u and if i initialize it in the function it will always make s=u. However if i initialize it in the program s still equals u. I'm lost can someone help me. Here is my code
# include <stdio.h>
# include "simpio.h"
# include "genlib.h"
# include "strlib.h"
int power(int num){
int u,v,r,s;
s=s*v;
}
main()
{
int u,v,r,s,pow;
printf("whats the base");
u=GetInteger();
printf("whats the power");
v=GetInteger();
r=v;
while(r!=0)
{
pow=power(s);
r=r-1;
}
if(u==0&&v<0)
printf("undefined");
else
printf("the result is %d",s);
getchar();
}