Salve a tutti, premetto k sono alle prime armi ma devo fare un esame fra poki gg. in programamzione ma acnoar nn ho capito bene alcune cose sulle stringhe, infatti ho creato una classe ESAME ma nn riesco a mettere da input il nome dell esame nell oggetto!!
Vi posto i codice k ho scritto usando come ide Eclipse.
Esame.h

#ifndef ESAME_H_
#define ESAME_H_
#include <iostream>

typedef char* STRING;

class Esame{
private:
int voto,cfu;
STRING nome;
public:
Esame();
void inserisciNome(STRING);
void inserisciVoto(int );
void inserisciCfu(int);
int getVoto()const;
int getCfu()const;
STRING getNome(STRING)const;

void stampaTutto();

};

#endif /* ESAME_H_ */

Esame.cpp


#include "Esame.h"
#include <iostream>
using namespace std;

Esame::Esame(){
voto=0;
cfu=0;
nome=0;
}

void Esame::inserisciVoto(int voto1){ voto=voto1 ; }

void Esame::inserisciCfu(int cfu1){ cfu=cfu1;}
void Esame::setNome(STRING nome1){ nome=nome1;}

int Esame::getVoto()const{ return voto;}

int Esame::getCfu()const{ return cfu;}
STRING Esame::getNome()const{ return nome;}

void Esame::stampaTutto(){
cout<<"il voto è: "<<voto<<" il cfu è : "<<cfu<<endl;
}

Test.cpp

#include<iostream>
#include "Esame.h"
#include<string>
using namespace std;

int main (){
Esame e;
STRING nome;


cout<<"\n inserisci nome: "<<endl;
cin.getline(nome,20);
e.getNome(nome);

return 0;
}