how to declare an array of size n in c++ code example Example 1: array declaration c++ int foo [5]; Example 2: create array c++ int foo[5] = {0};