联想校园招聘笔试题

综合知识 · 历年真题改编 · 题号 42042
多选题综合知识难度 3真题改编中大厂

题目

char a = 'a'; int b = static_cast<char>(a);//语句A double *c = new double; void *d = static_cast<void*>(c);//语句B int e = 10; const int f = static_cast<const int>(e);//语句C const int g = 20; int *h = static_cast<int*>(&g);//语句D class Base {}; class Derived : public Base {} Base* pB = new Base(); if(Derived* pD = static_cast<Derived*>(pB)) {}//语句E Derived* pD = new Derived(); if(Base* pB = static_cast<Base*>(pD)) {}//语句F

选项4 个

A语句ABCF正确
B语句ADE正确
C语句DE错误
D语句ABCD正确
🔒 答案与解析:登录后可查看本题答案、解析与考点讲解,并可在线作答自动判分 登录 / 注册
‹ 上一题 全部专题 下一题 ›

同类型题目综合知识 · 继续练习

题目免费浏览 · 整套练习与模拟考登录后开始 · 答案与解析登录后可见