From 3ecb6a28aa8e80ece29ab41ae346594f822ce611 Mon Sep 17 00:00:00 2001 From: huihut Date: Sun, 27 Jul 2025 19:53:17 +0800 Subject: [PATCH] fix typeid https://github.com/huihut/interview/issues/12#issuecomment-860158224 --- README.md | 2 +- README_en.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7f175c..f0afc34 100644 --- a/README.md +++ b/README.md @@ -1173,7 +1173,7 @@ catch (bad_cast b) { #### typeid * typeid 运算符允许在运行时确定对象的类型 -* type\_id 返回一个 type\_info 对象的引用 +* typeid 返回一个 type\_info 对象的引用 * 如果想通过基类的指针获得派生类的数据类型,基类必须带有虚函数 * 只能获取对象的实际类型 diff --git a/README_en.md b/README_en.md index 283488f..3429f31 100644 --- a/README_en.md +++ b/README_en.md @@ -1180,7 +1180,7 @@ catch (bad_cast b) { #### typeid * The typeid operator allows determining the type of an object at runtime -* type \ _id returns a reference to a type \ _info object +* typeid returns a reference to a type\_info object * If you want to get the data type of the derived class through the pointer of the base class, the base class must have a virtual function * Can only get the actual type of the object