From f7af99f12c0e204a96205825f3f190079980be54 Mon Sep 17 00:00:00 2001 From: huihut Date: Fri, 25 Jul 2025 20:45:01 +0800 Subject: [PATCH] fix Casting Operators https://github.com/huihut/interview/issues/113 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2373a61..87b2dd1 100644 --- a/README.md +++ b/README.md @@ -1102,7 +1102,7 @@ unique_ptr 是 C++11 才开始提供的类型,是一种在异常时可以帮 | 转换类型 | 安全性 | 示例 | |--------------------------|--------------|--------------------------| -| 数值类型转 | ✅ 安全 | `float f=3.14; int i=static_cast(f);` | +| 数值类型转换 | ✅ 安全 | `float f=3.14; int i=static_cast(f);` | | 类向上转换 | ✅ 安全 | `Derived* d; Base* b=static_cast(d);` | | 类向下转换 | ⚠️ 不安全 | `Base* b=new Base; Derived* d=static_cast(b);` | | 类不变转换 | ✅ 安全 | `MyClass* p; MyClass* same=static_cast(p);` |