i created a header Persona.h and in Persona.cc i am initializing all the variables and functions of the class, why can't i access a variable from Persona.cc?
Persona.h
#ifndef STD_LIB_H
#include <iostream>
#endif
#ifndef STD_LIB_H
#include <string>
#endif
class Persona
{
private:
std::string Nome;
public:
Nasci(std::string);
};
Persona.cc
#ifndef Persona_h
#include "Persona.h"
#endif
#ifndef STD_LIB_H
#include <string>
#endif
void Persona::Nasci(std::string nome)
{
// Nome della persona
Nome = nome;
};
it gives me an error:
invalid use of non-static data member 'Persona::Nome'
i can't figure out what to do, can you?
Thank You.