diff options
-rw-r--r-- | 7p34.cpp | 14 | ||||
-rw-r--r-- | 7p35.cpp | 32 |
2 files changed, 46 insertions, 0 deletions
diff --git a/7p34.cpp b/7p34.cpp new file mode 100644 index 0000000..680fa7d --- /dev/null +++ b/7p34.cpp @@ -0,0 +1,14 @@ + +/* + * + * 7.34 + * + * + */ + +int main () { + + // The type would be private so we wouldnt be able to use it outside the class + // The type would be declared after all the variables using it and that gives a compiler error (for me) + return 0; +} diff --git a/7p35.cpp b/7p35.cpp new file mode 100644 index 0000000..094d1df --- /dev/null +++ b/7p35.cpp @@ -0,0 +1,32 @@ +#include <iostream> + +/* + * + * 7.35 + * + * + */ + +typedef std::string Type; +Type initVal(); +class Exercise { +public: + typedef double Type; + Type setVal(Type); // double / double + Type initVal(); // double +private: + int val; +}; + +Exercise::Type Exercise::setVal(Exercise::Type parm) { + val = parm + initVal(); // double initVal() is used + return val; // Return val as double? +} + +Exercise::Type Exercise::initVal() { + return 0; +} + +int main () { + return 0; +} |