#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
main(int argc, char *argv[])
{
char ch;
if(argc!=3) {
cout << "Usage: NAME <filename> <starting location>\n";
return 1;
}
ifstream in(argv[1]);
if(!in) {
cout << "Cannot open file";
return 1;
}
in.seekg(atoi(argv[2]), ios::beg);
while(in.get(ch))
cout << ch;
return 0;
}
|