路透常考笔试题分享

时间:2024-10-25 18:43:18 综合指导

路透常考笔试题分享

  路透常考笔试题分享:

路透常考笔试题分享

  1.class

  {

  public:

  void f();

  const void g();

  private;

  int data;

  }

  下面哪个选项可以访问data?

  a.g() b.f() c. g()和f() d.都不可以

  2.which one calls a program to halt?(multiple answers)

  A.assert(10>0) B.assert(10<0) C.assert(x=0) D.assert(x<0)< p="">

  3.void time(int year,int moth=10,date=10);

  下面哪些选项可以正确调用time()?

  a.time(1995);

  b.time(1995,1);

  c.time(1995,1,2);

  d.都不可以

  4.下面哪个选项可以访问一个类的私有成员?

  a.友元类的公有成员函数 b.类的公有成员函数 c.类的私有成员函数 d.都可以 e.都不可以

  5.下面是一个类的几个部分,哪些部分有错误?

  a.void ~Time(int);

  b.class Time

  {

  public:

  private:

  int hour=0;

  };

  c.int Time(const char*,const char*);

  d.Time(const char*,const char*);

  6.什么时候会用到模版类?

  7.(大概是这么个意思)

  #include

  int a =0;

  void fn(int j,int *k)

  {

  int i=0;

  i++;

  int a=1;

  *k=a;

  j=i;

  }

  void main()

  {

  fn(1,2);

  cout<< p="">

  cout<<*k<< p="">

  cout<< p="">

  }

  a,b,c句的打印结果是什么?

  8.void f(________head_ptr);

  其中head_ptr是链表的头,f()是一个要对链表进行某种操作的函数,这个链表可能本来有一个头结点。

  横线上应该填什么?

  a.node *, b.node &, c.node*&, d.node

  9. 一个二叉树

  10

  /

  2 15

  / /

  1 30 3 5

  移去二叉树的根节点并且用其他节点代替,用哪些节点使这个二叉树不受影响?

  a. 2 b.15 c.1 d.3 e.5

  10.(题目都没看懂)

  circular array of CAPACITY elements, last is an index into that array, formular for the index afer last?

  11.MyStruct

  {

  int a;

  char*p;

  double b;

  }

  void main()

  {

  MyStruct s[20];

  MyStruct *p1=(MyStruct*)malloc(sizeof(MyStruct));

  MyStruct*p2=new MyStruct;

  }

  求sizeof(MyStruct),sizeof(s);sizeof(p1),sizeof(p2);

  12.

  int fn(char *s)

  {

  int a=0;

  while(*s++)

  {

  a++;

  }

  return a;

  }

  void main()

  {

  char str[20]="AAABBBCCC";

  int i=fn(str);

  int j=sizeof(str);

  strcpy(str+3,"DDD");

  cout<< p="">

  }

  i=?,j=?,最后输出的str=?


【路透常考笔试题分享】相关文章:

投资顾问面试常考笔试题分享!11-19

销售类职位常考笔试题目分享05-07

富士施乐常考笔试题目类型分享11-21

广告公司常考笔试题08-10

报社记者招聘:最常考的笔试题分享11-19

腾讯笔试题 试题分享02-24

迅雷JAVA广州站二笔笔试题目分享11-21

采购人员笔试题,试题分享02-25

AC尼尔森笔经分享11-19

SK笔经经历分享11-27