Is f(int &x) a valid call-by-reference syntax in C?
#include<stdio.h>
int f(int *,int);
int main()
{
int num1,num2,*ptr=&num1;
num1=5;
num2=f(ptr,num1);
printf(“Answer is %d”,num2);
}
int f(int &x,int c){
c=c-1;
if(c==0) return 1;
x=x+1;
return f(x,c)*x;
}
Posted on February 22, 2013, in Uncategorized. Bookmark the permalink. Leave a Comment.
Leave a Comment
Comments (0)