Parsing program.txt files, however their is a problem when dynamically allocating array size