Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - The parameter type in C language is int &;; Why is there an error prompt?
The parameter type in C language is int &;; Why is there an error prompt?
I think the problem you mentioned appears in the parameters of the function? Please look at the following example:

# include & ltstdio.h & gt

void Fun 1。 e)

{

e = 9;

}

Invalid function 2(int *e)

{

* e = 9;

}

int main()

{

int a = 5;

fun 1(a);

printf("%d\n ",a);

a = 5;

fun 2(& amp; a);

printf("%d\n ",a);

Returns 0;

}

Although the final effect of these two functions is the same, they both change the value of a, but in the function, the meaning of parameters is different. In the first function, e is an integer variable; In the second function, e is an integer pointer variable.