hello
I'm new to c++ and I'm writing a program for a college project.
I'm getting an error I don't understand, if someone can help me with it I'll be thankful
Oh, and by the way, the functions names are in French, hope this wont be a problem.
Here is my code :
faisceau.h:
#ifndef FAISCEAU_H
#define FAISCEAU_H
#include <vector>
#include <iostream>
#include "photon.h"
class photon;
class faisceau
{
public:
void initialise(long long tps);
faisceau copie();
void affichefaisceau();
private:
std::vector<photon> tab_photon;
};
#endif
and faisceau.cpp:
#ifndef FAISCEAU_CPP
#define FAISCEAU_CPP
#include <vector>
#include <iostream>
#include "faisceau.h"
#include "photon.h"
void faisceau::initialise(long long tps)
{
photon photon_lu(tps,0);
tab_photon.push_back(photon_lu);
}
void faisceau::affichefaisceau()
{
std::vector<photon>::iterator iter;
for(iter=((*this).tab_photon).begin(); iter!=((*this).tab_photon).end();iter++)
{
cout << *iter << "\n";
}
}
faisceau faisceau::copie()
{
return(*this);
}
#endif
I'm getting this error line :
faisceau.cpp:20: error: no match for ‘operator<<’ in ‘std::cout << iter.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = photon*, _Container = std::vector<photon, std::allocator<photon> >]()’