登录
|
注册
公司
标签
文章
搜索
C语言工程师
热门公司
迅雷
腾讯
百度
奇虎360
微软
华为
所有
有回答
没回答
新题目
有最佳答案
排序
热度
·
时间
·
经典指数
1
1
2545
#include<iostream> using namespace std; class Base { public: virtual int foo(int x) { return x * 10; } int foo(char x[14]) { return sizeof(x) + 10; } }; class Derived: public Base { int foo(int x) { return x * 20; } virtual int foo(char x[10]) { return sizeof(x) + 20; } } ; int main() { Derived stDerived; Base *pstBase = &stDerived; char x[10]; printf("%d\n", pstBase->foo(100) + pst ...
阅读题目
腾讯
C语言工程师
单选题
经典指数
2
0
8205
假定一个类的构造函数为A(int aa,int bb){a=aa--;b=a*bb;},则执行A x(4,5);语句后,x.a和x.b的值分别为() 20和5 3和15 5和4 4和20 ...
阅读题目
百度
2016
研发工程师
C语言工程师
单选题
经典指数
1
0
3597
有一场演出,共八位演员A,B,C,D,E,F,G,H参加,对其出场次序有如下要求:BH需在A之后出厂,E出场之后BF才能出场,D需要在CH之前、B之后出场,F需要在CD之前出场,G需要在CH之后出场,则下列说法正确的是() ① 无法唯一确定B第几个出场 ② 无法唯一确定D第几个出场 ③ 演员的出场次序有且仅有4种方案可选 ④ 任意一种方案C都必然在第6位出场 ⑤ 演员的出场次序最多可以有6中方案可选 (A)①③ (B)②⑤ (C)①④⑤ (D)②③④ ...
阅读题目
2015
金山
研发工程师
C语言工程师
单选题
经典指数
1
0
4255
以下涉及到内存管理的代码段中,有错误的是: int *a=new int(12); //..... free(a); int *ip=static_cast<int*>(malloc(sizeof(int))); *ip=10; //..... delete ip; double *a=new double[1]; //.... delete a; int *ip=new int(12); for(int i=0;i<12;++i){ ip[i]=i; } delete []ip; ...
阅读题目
腾讯
2016
研发工程师
C语言工程师
多选题
经典指数
1
0
1788
下列程序的输出结果是 #include<iostream> using namespace std; int main() { int a[] = {2, 4, 6, 8, 10}, *p, **k; p = a; k = &p; printf(" % d", *(p++)); printf(" % d\n", **k); return 0; } 4 4 2 4 2 2 4 6 ...
阅读题目
迅雷
C语言工程师
单选题
经典指数
1
0
2671
用你最熟悉的语言写一个将字符串转换成int的代码. 目标int是32位, 字符串格式是10进制. 比如"10001"对应的int 是10001, 对应的"-20002"对应的是 -20002 java: int parseInt(String text); C/C++: int parseInt(const char *text); ...
阅读题目
Java
淘宝
C语言工程师
字符串
问答题
经典指数
1
0
2713
如果得到随机的字串,长度和字串中出现的字符表可定义,并将字串倒序显示,如把0123456789作为基准的字串字符表,产生一个6位的字串642031,打印出的字串为 130246,可使用bash/perl/php/c任意一种。 ...
阅读题目
PHP
百度
C语言工程师
字符串
问答题
经典指数
1
0
2103
如下程序 #include "stdio.h" class A { public: virtual void Test() { printf("A test\n"); } }; class B: public A { public: void func() { Test(); } virtual void Test() { printf("B test\n"); } }; class C: public B { public: virtual void Test() { printf("C test\n"); } }; void main() { C c; ((B *)(&c))->func(); ((B)c).func(); } 该程序的执行结果 C test B test B test B test B test C test A test C te ...
阅读题目
迅雷
C语言工程师
单选题
经典指数
1
0
1715
In C++, what does "explicit" mean? what does "protected" mean? explicit-keyword enforces only explicit casts to be valid Protected members are accessible in the class that defines them and in classes that inherit from that class. Protected members only accessible within the class defining them. All the above are wrong ...
阅读题目
微软
C语言工程师
多选题
经典指数
1
0
2326
在C++中,为了让某个类只能通过new来创建(即如果直接创建对象,编译器将报错),应该() 将构造函数设为私有 将析构函数设为私有 将构造函数和析构函数均设为私有 没有办法能做到 ...
阅读题目
京东
C语言工程师
单选题
经典指数
<<
<
1
2
3
4
5
6
>
>>
998
题目数
2
贡献者
1010
答案数
扫描后移动端查看
我也分享一个题目
相关标签
迅雷
研发工程师
2016
腾讯
百度
奇虎360
2015
微软
华为
2014
同类标签
研发工程师
游戏运营
产品运营
运维工程师
Android
测试工程师
.NET
iOS
机器学习
Go
微信公众号
欢迎加入,一起群聊
×
登录
注册
找回密码
记住登录
登录
快速注册
直接第三方登录