czwartek, 19 maja 2016

array size c++ java lenght substitute.

#include <iostream>

using namespace std;

int main()
{
        cout << "Array of integers" << endl;
        int numbers[10] = {1,2,3,4,5,6,7,8,9,0};
        int size = sizeof numbers/sizeof(int);
        cout << size << endl;

        for(int i=0;i<=size;i++)
        {
                cout << "elements at index " << i << endl;
        }
        return 0;
}

Brak komentarzy:

Prześlij komentarz