My question is how would i read attributes from the tokeniser in the same order as declaration occurs in the class declaration, separated by full-colons
[cpp]
Entertainment::Entertainment():_rating("NR"),_title(""),_purchaseDate(),_purchaseCost(),_publisher(""){}
int Entertainment::read(Tokeniser& tok)
{
_rating = tok.nextToken();
_title = tok.nextToken();
_purchaseDate = tok.nextToken();
_purchaseCost = tok.nextToken();
_publisher = tok.nextToken();
return 0;
}[/cpp]
[cpp]
Entertainment::Entertainment():_rating("NR"),_title(""),_purchaseDate(),_purchaseCost(),_publisher(""){}
int Entertainment::read(Tokeniser& tok)
{
_rating = tok.nextToken();
_title = tok.nextToken();
_purchaseDate = tok.nextToken();
_purchaseCost = tok.nextToken();
_publisher = tok.nextToken();
return 0;
}[/cpp]