A
Alex
Hi,
I want to read in enum types from standard input. Unfortunately it does not
work. The code is given as follows:
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
enum TYP { eins, zwei, drei};
int main()
{
    string input("datIn");
    ifstream IN(input.c_str());
    TYP t;
    cin >> t;  // Fehlermeldung
    return 0;
}
Do I have to define an input operator ?
Thank you for your help.
I want to read in enum types from standard input. Unfortunately it does not
work. The code is given as follows:
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
enum TYP { eins, zwei, drei};
int main()
{
    string input("datIn");
    ifstream IN(input.c_str());
    TYP t;
    cin >> t;  // Fehlermeldung
    return 0;
}
Do I have to define an input operator ?
Thank you for your help.