Skip to content

Commit

Permalink
added 7.33~7.35
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Nov 19, 2014
1 parent f428194 commit b6dcc25
Showing 1 changed file with 61 additions and 2 deletions.
63 changes: 61 additions & 2 deletions ch07/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,64 @@ XXXXXXXXXXXXXXXXXXXXXXXXX

std::string getAddr() const { return this->addr; } // unnecessary

## Exercise [7.31](ex7_31.h)
## Exercise [7.32](ex7_32.h)
## [Exercise 7.31](ex7_31.h)
## [Exercise 7.32](ex7_32.h)
## Exercise 7.33

[clang]error: unknown type name 'pos'

fixed:
```cpp
Screen::pos Screen::size() const
{
return height*width;
}
```

## Exercise 7.34

There is an error in

dummy_fcn(pos height)
^
Unknown type name 'pos'

## Exercise 7.35

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

Type Exercise::setVal(Type parm) { // first is `string`, second is `double`
val = parm + initVal(); // Exercise::initVal()
return val;
}
```
**fixed**
changed
```cpp
Type Exercise::setVal(Type parm) {
val = parm + initVal();
return val;
}
```
to
```cpp
Exercise::Type Exercise::setVal(Type parm) {
val = parm + initVal();
return val;
}
```
and `Exercise::initVal()` should be defined.

0 comments on commit b6dcc25

Please sign in to comment.