how to take array value from user in cpp gfg code example Example 1: create array c++ int foo[5] = {0}; Example 2: array c plus plus x = foo[2];