Well, it doesn't matter what function you use getline() or get(), it should be able to read each integer from your map.txt to the integer array mapp[2500]; but there seems to be some mistakes in your code which was used to create the map.txt, first, you haven't declare the variable h, sure it won't pass the compiler, not to mention what a bunch of errors you'll get when you're trying to compile it. Try to check the map.txt and see if there's actually something, if not, then that solves your problem. (BTW, the codes you wrote to get integer arrays assigned with 2500 values are correct, don't doubt it.) and good luck.