Storing a Fixed Number of Objects using array - C++ Data Type

C++ examples for Data Type:Array

Description

Storing a Fixed Number of Objects using array

Demo Code

#include <cinttypes>
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
    const int numberOfElements{ 5 };
    int32_t normalArray[numberOfElements]{ 10, 65, 3000, 2, 49 };

    for (int i{ 0 }; i < numberOfElements; ++i)
    {/*from w w  w. j  a  va2s  .c om*/
        cout << normalArray[i] << endl;
    }

    return 0;
}

Result


Related Tutorials