Added the code itself. From Drexel C tutorial and from stackexchange discussion about checking size and length of arrays.