D
D
Denis Akhunov2021-02-19 20:38:38
Kotlin
Denis Akhunov, 2021-02-19 20:38:38

Is it possible to work with an array in a function in Kotlin?

If it is possible, please tell me how it can be done? For example, in C++ it works like this:

void input(int x [], int size )
{
    for ( int i = 0; i < size; i++)
        x[i] = rand()%31-15;
    return;
}

- Random array in function ( C++ )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-02-19
@DeNySzZz

Yes, you can.
Only the syntax will be different.
https://kotlinlang.ru/docs/reference/basic-types.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question