Answers

Question and Answer:

  Home  Embedded System

⟩ Explain Why cannot arrays be passed by values to functions?

Because in C when you say the name of the array it means the address of the first element.

example :

int a[];

func (a);

int func(int a[]);

In this when you call the function by passing the argument a actually &a[0](address of first element) gets passed. Hence it is impossible to pass by value in C.

 208 views

More Questions for you: