Codice:
#include <iostream>
#include <stdlib.h>
#include <fstream>
#define MAX 50
using namespace std;
void nuovoprofilo();
int main()
{
char ch, nome_cognome[MAX];
cout << "Nuovo (n), Salvare (s) Lanciare (r) Uscire (q)" << endl;
cin >> ch;
while (ch!='q')
{
switch (ch)
{
case 'n':
cout << "Inserire nome e cognome" << endl;
cin.getline(nome_cognome,MAX); //perchè non funziona?!
cin.getline(nome_cognome,MAX);
nuovoprofilo();
break;
case 's':
//salvaprofilo();
break;
case 'r':
//lanciaprofilo();
break;
default : cout << "Nuovo (n), Salvare (s) Lanciare (r) Uscire (q)" << endl;
}
cin >> ch;
}
return 0;
}
void nuovoprofilo()
{
ofstream fout ("sample.grammar");
fout << "S : NS_B COMANDO OGGETTO NS_E" << endl << "S : NS_B RICHIESTA NS_E" << endl;
fout.close();
ofstream fout2 ("sample.voca");
fout2 << "% NS_B" << endl << "<s> sil" << endl << endl << "% NS_E" << endl << "</s> sil" << endl << endl << "% COMANDO" << endl << "ACCENDI a cc e n d i" << endl << "SPEGNI s p e ggn i" << endl << endl << "% OGGETTO" << endl << "LUCE l u c e" << endl << "TEIERA t e j e r a" << endl << endl << "% RICHIESTA" << endl << "AIUTO a j u t o" << endl;
fout2.close();
cout << "Registra la tua voce";
system("\"C:\\cygwin\\home\\Ciucci\\voxforge\\auto_ita\\prompts\"");
system("\"C:\\proga~1\\Audacity\\audacity.exe\"");
}
Ecco il mio codice modificato.
Mi da lo stesso errore. è da due giorni che ci sono sopra e non riesco a risolvere. Non sono più andato avanti