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!!

> Is this labary in Turbo/borland c++ difrent or what?
If you're referring to that 1980's fossil-ware, it's more than likely to be missing altogether.

Who's older - you or the compiler?

>vectro, problem!
>I am making a speel check program
>Is this labary in Turbo/borland c++ difrent or what?
>Uneable to open include file

Good choice of problems to solve. A spell checker is clearly needed here.

>i have a problem with the libary #include <vector.h>
<vector.h> is not a standard library. The vector template class resides in the standard header <vector>. All bets are off, and the recommendation you're most likely to get is upgrade your compiler and modernize your code.

Thank you guys, i will try a diffrent way...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.