Thread: Must use 1 argumentsPress any key to continue

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    20

    Must use 1 argumentsPress any key to continue

    //: C02:Seeking.cpp
    // Seeking in iostreams
    #include "require.h"
    #include <iostream>
    #include <fstream>
    using namespace std;

    int main(int argc, char* argv[])
    {
    requireArgs(argc, 1);
    ifstream in(argv[1]);
    assure(in, argv[1]); // File must already exist
    in.seekg(0, ios::end); // End of file
    streampos sp = in.tellg(); // Size of file
    cout << "file size = " << sp << endl;
    in.seekg(-sp/10, ios::end);
    streampos sp2 = in.tellg();
    in.seekg(0, ios::beg); // Start of file
    cout << in.rdbuf(); // Print whole file
    in.seekg(sp2); // Move to streampos
    // Prints the last 1/10th of the file:
    cout << endl << endl << in.rdbuf() << endl;
    } ///:~


    for the program abobve in VC++ 6 compiler

    i get the forlloiwng output

    Must use 1 argumentsPress any key to continue

    and i dont have a clue how to proceeed

    any tips ???

  2. #2
    Registered User
    Join Date
    Dec 2003
    Posts
    20

    Must use 1 argumentsPress any key to continue

    sorry sorted it out

    compiled it with g++ under cygwin with 1 argument of course

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    next time, post your code within code tags
    [ code ] [ /code ]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 10:00 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM