so i am currently studying c++ from programming principles and practices using c++ written by the creator of c++
there is a topic named "using tokens" in that he explained how to create user-defined type
he created a Token "Token"
class Token {
public:
char kind; // what kind of token
double value; // for numbers: a value
};
now the problem i am facing here is i am not able to define get_token() function
Token get_token(); // function to read a token from cin
vector<Token> tok; // we’ll put the tokens here
int main()
{
while (cin) {
Token t = get_token();
tok.push_back(t);
}
// . . .
}
so someone who knows how to solve this silly problem.. please reply. thanks in advance :)
Aucun commentaire:
Enregistrer un commentaire