Some minor errors (It surprises me that it compiled at all, in fact):
Code:
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib> // The non-deprecated version
using namespace std; // Not the best way to do things, but easiest for beginners
int main()
{
double a[100];int i,N;
cout<<"Type in the number of data points"<<endl;cin>>N;
if(N<=64)
{ //Read in data from datafile
ifstream source;
source.open("datafile");
if(!source)
{cerr<<"Can't open data file."<<endl;
system("PAUSE");
return(1);}
for(i=0;i<N;i++)
{source>>a[i];}
source.close();
}
else
{cerr<<"Too many data points."<<endl;return (1);}
int k,j=0,colnum=8; //Print out data set
for(j=0;j<N;j=j+colnum){
k=colnum;
if((j+colnum)>N){k=N-j;}
for(i=0;i<k;i++){cout<<setw(8)<<a[i+j];}
cout<<endl;}
system("PAUSE");
return 0;
}