How do you pass an array as a parameter?

To pass an array as a parameter to a function, pass it as a pointer (since it is a pointer). For example, the following procedure sets the first n cells of array A to 0. Now to use that procedure: int B[100]; zero(B, 100);

Sizin İçin Seçtik  What parameters are optional?

Leave a Reply

Your email address will not be published. Required fields are marked *

How do you pass an array as a parameter?

To pass an array as a parameter to a function, pass it as a pointer (since it is a pointer). For example, the following procedure sets the first n cells of array A to 0. Now to use that procedure: int B[100]; zero(B, 100);

Sizin İçin Seçtik  What is array of objects in C ++?

Leave a Reply

Your email address will not be published. Required fields are marked *