I have two header file Fibonaci.h, Fibonaci_Iterator.h, u can look below
Fibonaci.h
#ifndef __fibonaci__
#define __fibonaci__
#include "stdafx.h"
#include "Fibonaci_Iterator.h"
using namespace std;
class Fibonaci
{
public:
//typedef Fibonaci_Iterator iterator;
Fibonaci_Iterator begin(); --> [B]syntax error missing ; before begin[/B]
Fibonaci_Iterator end();
Fibonaci( const int& );
Fibonaci( const int&, const int& );
bool isElem( const int& );
void genElem();
void genElemToValue( const int& );
void printElem();
static vector<int> _elems;
private:
friend int Fibonaci_Iterator::operator*(); --> [B]Fibonaci_Iterator is not a class or namespace name[/B]
friend void Fibonaci_Iterator::checkValidity() const;
int _length;
int _beg_pos;
};
#endif
Fibonaci_Iterator.h
#ifndef __fibonaci_iterator__
#define __fibonaci_iterator__
#include "Fibonaci.h"
class Fibonaci_Iterator
{
public:
Fibonaci_Iterator( const int& );
bool operator==( const Fibonaci_Iterator & ) const;
bool operator!=( const Fibonaci_Iterator & ) const;
Fibonaci_Iterator& operator++();
Fibonaci_Iterator operator++( int );
int operator*();
void checkValidity() const;
private:
int _index;
};
#endif
When i compile, i get a lot of error, i put some above.
In first error syntax error missing ; before begin, why did i get this error in function Fibonaci_Iterator begin(); --> i make function with return value class Fibonaci_Iterator and Ive put header Fibonaci_Iterator.
In the second error Fibonaci_Iterator is not a class or namespace name, how to resolve this???