软件设计课件:Lecture 07 C++ Operator Overloading.pptVIP

  • 0
  • 0
  • 约 49页
  • 2021-12-01 发布于安徽
  • 举报

软件设计课件:Lecture 07 C++ Operator Overloading.ppt

软件设计课件:Lecture 07 C++ Operator Overloading

array1.h (2 of 2) why there are two operator[] methods here? array1.cpp (1 of 6) array1.cpp (2 of 6) array1.cpp (3 of 6) array1.cpp (3 of 6) array1.cpp (4 of 6) array1.cpp (5 of 6) array1.cpp (6 of 6) fig18_04.cpp (1 of 4) fig18_04.cpp (2 of 4) fig18_04.cpp (3 of 4) fig18_04.cpp (4 of 4) Array output (1 of 1) # of arrays instantiated = 0 # of arrays instantiated = 2 ? Size of array integers1 is 7 Array after initialization: 0 0 0 0 0 0 0 ? Size of array integers2 is 10 Array after initialization: 0 0 0 0 0 0 0 0 0 0 Input 17 integers: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 After input, the arrays contain: integers1: 1 2 3 4 5 6 7 integers2: 8 9 10 11 12 13 14 15 16 17 ? Evaluating: integers1 != integers2 They are not equal ? Size of array integers3 is 7 Array after initialization: 1 2 3 4 5 6 7 Array output (2 of 2) Assigning integers2 to integers1: integers1: 8 9 10 11 12 13 14 15 16 17 integers2: 8 9 10 11 12 13 14 15 16 17 Evaluating: integers1 == integers2 They are equal integers1[5] is 13 Assigning 1000 to integers1[5] integers1: 8 9 10 11 12 1000 14 15 16 17 Attempt to assign 1000 to integers1[15] Assertion failed: 0 = subscript subscript size, file Array1.cpp, line 95 abnormal program termination Cast operator Convert objects into built-in types or other objects C

文档评论(0)

1亿VIP精品文档

相关文档