My program returns and error et I don't know why . How I can resolve this ?
Error:
error: cannot bind 'std::ostream {aka std::basic_ostream}' lvalue to 'std::basic_ostream&&'| error: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits; _Tp = Personne]'|
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
struct Personne { int age; int nb_ami; };
int main()
{
std::cout << "Entrer le nom du fichier: " << std::endl;
std::string fileUser{};
std::cin >> fileUser;
std::ofstream(fileUser.c_str());
std::cout << "Quel age avez-vous ?" << std::endl;
std::vector<Personne> tab(1);
std::cin >> tab[0].age;
for (unsigned int i{}; i < tab.size(); i++){
std::cout << tab[i] << std::endl;
}
return 0;
}