foo.cpp:9:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
foo.cpp: In function 'int main()':
foo.cpp:13:16: warning: format '%ld' expects argument of type 'long int*', but argument 2 has type 'int*' [-Wformat]
foo.cpp:16:28: warning: format '%ld' expects argument of type 'long int*', but argument 2 has type 'int*' [-Wformat]
foo.cpp:16:28: warning: format '%ld' expects argument of type 'long int*', but argument 3 has type 'int*' [-Wformat]
foo.cpp:21:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cpp:23:7: error: incompatible types in assignment of 'int' to 'int [(((sizetype)(((ssizetype)n) + -1)) + 1)]'
foo.cpp:12:10: warning: unused variable 'j' [-Wunused-variable]