Tencent 2014 intern software development test

Source: Internet
Author: User

Because I signed a confidentiality agreement but did not bring my exam out, I just recalled it. I don't know if this is a violation of the Agreement. If yes, contact me.

Several programming questions are recalled here:

Void fun (char ** a) {* a + = 2;} int main () {char * a [] = {"123", "456 ", "abc"}, ** r; r = a; fun (r); printf ("% s", * r );}

This is probably the case. The answer is 3;


Class BASE {public: virtual int foo (int a) {return a * 10;} int foo1 (char a [10]) {return sizeof (a) + 10 ;}}; class Derived: public BASE {public: int foo (int a) {return a * 20;} virtual int foo1 (char a [20]) {return sizeof () + 10 ;}}; int main () {Derived a; BASE * B = & a; char c [10]; cout <B-> foo (100) + B-> foo1 (c );}

The answer is 2014. The array is passed as a parameter, so it should be + 4;

Var a = {"value": "2", "int": 1} var B = a; alert (a. value + B .int );
The answer is 21. javascript knowledge.

The rest will be written later.

Anyone reprint or reference please indicate the source: http://blog.csdn.net/yuchen_2012/article/details/23549175



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.