[Dev-C++] Problems with a for loop again
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Paul S. <Ps...@le...> - 2002-03-10 19:21:41
|
Here is the full code, pasted the wrong code in last message.
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
=20
int main(int argc, char *argv[])
{
int filesize=3D0;
vector<string> v;
ifstream in("Backvector.cpp");
string line;
while(getline(in, line))=20
v.push_back(line); // Add the line to the end=20
filesize=3Dv.size(); // Get number of lines in file
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
do {
cout << filesize << ": " << v[filesize] << endl;
filesize=3Dfilesize-1;
} while(filesize >0);
system("PAUSE");
return 0;
} ///:~
=20
|