As the name of getline() implies, it's used for reading entire lines at a time... if you want to read an integer at a time... try this:
ifstream file;
file.open( "C:\\TestFile.txt");
int test[5] = {0};
for( int i=0; i<5; i++)
file >> test[i];
file.close();
Now for this code I just read in 5 numbers into a flat 1D array, but that should give you the right idea of what you need to do. If you need it to be dynamic, you'll have to allocate the array dynamically:
int *test;
test = new int[size];
delete [] test;