Hello guys
I am making a speel check program in Turbo/borland c++ and i have a problem with the libary #include <vector.h>. Is this labary in Turbo/borland c++ difrent or what?
Here is the program:
#include <iostream.h>
#include <fstream.h>
#include <vector.h>
#include <string.h>
vector<string> explode( const string &znak, const string &recenica)
{
vector<string> polje;
int duljinar = recenica.length();
int duljinaz = znak.length();
if (duljinaz==0)
return polje;
int i=0;
int k=0;
while( i<duljinar )
{
int j=0;
while (i+j<duljinar && j<duljinaz && recenica[i+j]==znak[j])
j++;
if (j==duljinaz)
{
polje.push_back( recenica.substr(k, i-k) );
i+=duljinaz;
k=i;
}
else
{
i++;
}
}
polje.push_back( recenica.substr(k, i-k) );
return polje;
}
int trazi(const vector< string > &sto, const vector< string > &gdje, int j)
{
int max=gdje.size();
if (max==0) return false;
for(int i=0; i<max; i++)
if (gdje[i]==sto[j])
return true;
return false;
}
main(){
string recenica,rjecnik,nep_rijeci="";
int k=0;
cout << "Unesite recenicu ";
getline(cin, recenica);
fstream dat;
dat.open("text.txt",ios::in);
getline(dat,rjecnik);
vector<string> rijeci_unos = explode(" ",recenica);
vector<string> rijeci_iz_dat = explode(" ",rjecnik);
for(int i=0; i < rijeci_unos.size(); i++)
{
if(!trazi(rijeci_unos,rijeci_iz_dat,i))
{
nep_rijeci +=rijeci_unos[i];
nep_rijeci +=" ";
}
}
cout << "Nepoznate rijeci su " << nep_rijeci << endl;
system("pause");
}
The messege is: Uneable to open include file "Vector.H"
AND
Declaration terminated incorrectly!!