home *** CD-ROM | disk | FTP | other *** search
- #include <stream.h>
-
- // multiple solutions, one in level 0 and one in level 1
-
- overload foo;
-
- void foo (int x, int y)
- {
- cout << "level 0 solution\n";
- }
-
-
- void foo (char c, double d)
- {
- cout << "level 1 solution\n";
- }
-
- main()
- {
- char c;
- int i;
- foo (c,i);
- // level 0 solution: char exact match for int
- // level 1 solution: int converted to double
-
- // Zortech causes syntax error:
- // cannot uniquely determine which function 'foo' to call
- // and no code generated.
-
- // Guidelines gives level 0 solution with no warnings.
-
- }
-