Well for one you declare a array with 41 elements and only seem to need 5. And the lovely thing about fstream is operator overloading so if you want to read in something it's very easy.
#include <iostream>
#include <fstream>
int main()
{
int i = 0;
int array[5];
int max_read = 5;
int amountRead = 0;
std::ifstream in("part.txt",std::ios::in |std::ios::binary);
if(!in)
{
std::cout<<"Could not open file"<<std::endl;
return 1;
}
//this is where we are reading in the information into our array
while(in>>array[amountRead]&& amountRead < max_read)
{
amountRead++;
}
for(i = 0; i < 5; i++)
{
std::cout<<array[i]<<std::endl;
}
std::cin.get();
return 0;
} Oh and please use Code Tags