struntz
Dec 10th, 2000, 01:19 AM
Hello everyone...
im' currenlty reading this book....
and its called thinking in C++
well the problem is,
look at this code..
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <conio.h>
using namespace std;
int main() {
vector<string> v;
ifstream in("FillVector.cpp");
string line;
while(getline(in,line))
v.push_back(line);
for(int i = 0; i < v.size(); i++)
cout << ": " << v[i] << endl;
getch();
return 0; }
i get an error that says....
c:\my documents\c++programs\fillvectandwhitesapces.cpp: In function `int main()':
c:\my documents\c++programs\fillvectandwhitesapces.cpp:16: implicit declaration of function `int getchar(...)'
and i also tried other forms like getchar() and using differnet things but still i get an error, like on somes, it says directory wasn't found...
so what am i doing wrong?
the code works fine until i try and put the last piece of code in so u have to press a button for it to EXIT,and this is console of coures....
if u know whats going on, please explain it :D
THanks for listening!:)
im' currenlty reading this book....
and its called thinking in C++
well the problem is,
look at this code..
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <conio.h>
using namespace std;
int main() {
vector<string> v;
ifstream in("FillVector.cpp");
string line;
while(getline(in,line))
v.push_back(line);
for(int i = 0; i < v.size(); i++)
cout << ": " << v[i] << endl;
getch();
return 0; }
i get an error that says....
c:\my documents\c++programs\fillvectandwhitesapces.cpp: In function `int main()':
c:\my documents\c++programs\fillvectandwhitesapces.cpp:16: implicit declaration of function `int getchar(...)'
and i also tried other forms like getchar() and using differnet things but still i get an error, like on somes, it says directory wasn't found...
so what am i doing wrong?
the code works fine until i try and put the last piece of code in so u have to press a button for it to EXIT,and this is console of coures....
if u know whats going on, please explain it :D
THanks for listening!:)