diff options
| author | Cliff Click <cliffc@acm.org> | 2024-12-29 16:02:12 -0800 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-01-15 15:07:30 -0800 |
| commit | 01f23ae95f2bb609d2d76e0d2d66eecbedd0619d (patch) | |
| tree | 35b1ea46eaca33520278f126c7910a345fcb80c0 /chapter17 | |
| parent | e0992778a94ae7f5a8a56201a7ceba0a14ec1300 (diff) | |
| download | Simple-01f23ae95f2bb609d2d76e0d2d66eecbedd0619d.tar.gz Simple-01f23ae95f2bb609d2d76e0d2d66eecbedd0619d.zip | |
Update README.md
Diffstat (limited to 'chapter17')
| -rw-r--r-- | chapter17/README.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chapter17/README.md b/chapter17/README.md index f6216398..e0c8d6d9 100644 --- a/chapter17/README.md +++ b/chapter17/README.md @@ -134,3 +134,18 @@ for( int i=0; i<arg; i++ ) return i; // ERROR: Undefined name 'i' ``` +A broken `find` call: +```cpp +for( int i=0; i<ary#; i++ ) + if( ary[i]==e ) + break; +do_stuff(i); // ERROR: undefined name 'i' +``` + +An example `find` call: +```cpp +for( int i=0; i<ary#; i++ ) + if( ary[i]==e ) + return i; +return -1; +``` |
