mardi 28 juillet 2015

Name Lookup and class scope

Why is it that the return type of setVal is of type string and the parameter type is of type double

typedef string Type;
Type initVal(); 
class Exercise {
public:
    typedef double Type;
    Type setVal(Type); 
    Type initVal(); 
private:
    int val;
};

Type setVal(Type parm) {  
    val = parm + initVal();    
    return val;
}

Aucun commentaire:

Enregistrer un commentaire