0

How to initialize an array with a list of numbers in Eiffel?

In C it would be like this:

int foo[] = {2, 3, 5, 7, 10, 87, 72, 67, 1, 0};

David Zaragoza
  • 119
  • 1
  • 6

1 Answers1

4

Like This:

make
    local
        foo: ARRAY [INTEGER]
    do
        foo := << 2, 3, 5, 7, 10, 87, 72, 67, 1, 0 >>
    end
Louis M
  • 576
  • 2
  • 4