Now I dont know what I did wrong, but when I tried compiling it into a .exe file the command prompt said:
C:\My Programs>c++ arrays.cpp -o arrays.exe
arrays.cpp:15: error: expected constructor, destructor, or type conversion befor
e '<<' token
arrays.cpp:16: error: expected constructor, destructor, or type conversion befor
e '<<' token
arrays.cpp:17: error: expected constructor, destructor, or type conversion befor
e '<<' token
arrays.cpp:18: error: expected constructor, destructor, or type conversion befor
e '<<' token
arrays.cpp:19: error: expected constructor, destructor, or type conversion befor
e '<<' token
arrays.cpp:20: error: expected constructor, destructor, or type conversion befor
e '<<' token
arrays.cpp:21: error: expected constructor, destructor, or type conversion befor
e '<<' token
arrays.cpp:22: error: expected unqualified-id before "return"
arrays.cpp:24: error: expected declaration before '}' token
If you understand this, please reply.
*Page 19 of C++ Programming in easy steps by Mike Mcgrath.*