Yurttas/PL/OOL/Cplusplus/F/06/02/00/01/io gs 01.cpp

From ZCubes Wiki
Revision as of 22:52, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="cpp" line start="1" enclose="div">/* Copyright(C) 1998 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. Perm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 1998
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9
10   date   : January 1, 1998.
11   author : Salih Yurttas.
12
13   io_gs_01.cpp
14*/
15
16
17#include <iostream>
18
19#include <vector>
20#include <string>
21
22using namespace std;
23
24vector<string> get_vector_line(const char*);
25
26vector<string> double_space(const vector<string>&);
27
28void put_vector_line(const char*,
29                     const vector<string>&);
30
31int main(int argc, char* argv[]) {
32
33  if(argc!=3) {
34    cout << "\nUsage: " << argv[0]
35         << " infile outfile\n";
36    exit(1);
37  }
38
39  vector<string> data = get_vector_line(argv[1]);
40
41  data = double_space(data);
42
43  put_vector_line(argv[2],
44                  data);
45
46}