initializing an array in cpp with 1 code example Example 1: c++ initialise array int nCount[] = {1, 2, 3, 4, 5}; Example 2: initialize array c++ int foo [5];