Sogou C + + Engineer Pen Test

Source: Internet
Author: User

 small-end method and big-endian method1 Questions:Suppose that the integer 0x12345678 is stored in a contiguous four bytes (that is, the address 0x0 to 0x3) starting at the memory address 0x0. In memory stored in little endian byte order, the bytes in the address 0x3 are:correct answer: A your answer: D (Error) 0x120x340x560x78parsing:a) The Little-endian is the low-bit bytes emitted at the lower address of the memory, high-bit bytes emitted in the memory of the higher address. b) The Big-endian is the high-bit byte emitted at the low address of the memory, and the low byte is discharged at the upper address of the memory. c) Network byte order: The TCP/IP layer protocol defines the byte order as Big-endian, so the byte order used in the TCP/IP protocol is often referred to as the network byte order. if it is little-endian:0x0-0x3 memory is stored separately: 0x78,0x56,0x34,0x12; If the big-endian:0x0-0x3 memory is stored separately: 0x12,0x34,0x56,0x78; sizeof 6 under Linux 64-bit C program, please calculate the output of the three sizeof respectively is ()
void func( char str_arg[ 100 ]) {       cout<<sizeof(str_arg)<<endl; } int main( int argc, char * argv[]) {       char str[]= "Hello" ;       char *p=str;       cout<<sizeof(str)<<endl;       cout<<sizeof(p)<<endl;       func( "test" );       return 0 ; } The correct answer: D your answer: B(Error)5,5,86,6,46,8,46,8,8sizeof logs the length of the array to the true length, and the length of the string arrays is added to the last ' \ S ' character. the 64-bit machine has a 8-byte pointer. This is primarily a measurement object that distinguishes the sizeof operator
sizeof (STR) measures the length of the character array, noting that the string is a plus, so it is 6 .
sizeof (p) measures the length of the pointer, which is 8 bytes under the 64-bit system .
sizeof (STR_ARG) measures the length of the pointer, because this is the formal parameter.
MFCThe typical process for creating a Windows window process is () the correct answer: A your answer: B(Error)Registration Window--Windows--window--Windows--Windows--window, Update window, Windows--Windows, creating Windows, Update window, window---Windows--window--Create Windows--window--Message loop Creation window--Update window Display window, message loop Creation window, registration window, Windows-window, Update window The process of displaying a window on the screen is typically the following procedure, which is the structure flow of the main program:
(1) Get the application handle (GetModuleHandle).
(2) Registration window class (RegisterClassEx). Before registering, you must fill in the RegisterClassEx parameter wndclassex structure first.
(3) Build window (CreateWindowEx).
(4) Display window (showwindows).
(5) Refresh window client area (UpdateWindow).
(6) Enter an infinite loop of message acquisition and processing. Gets the message first (GetMessage), dispatches the message to the callback function processing (dispatchmessage) If a message arrives, and exits the loop if the message is wm_quit.Calculate time Complexity

26 Assuming that the computational time of an algorithm can be represented by a recursive relational T (n) =2t (N/2) +n, the time complexity of the algorithm is ()The correct answer: b your answer: b(correct)O (logn) o (n*logn) o (n) O (n^2)T (2n) = 2t (n) + 2nT (2n)/2n = t (n)/n + 1make C (n) = t (n)/nthen C (2n) = C (n) + 1C (2n)-C (n) = 1i.e. C (2^k)-C (2^ (k-1)) = 1Accumulate sumC (2^k) = C (1) + Ki.e. T (2^k)/(2^k) = C (1) + Ki.e. T (2^k) = (c (1) + k) * (2^k)i.e. t (n) = (c (1) + log2 (n)) * N

Sogou C + + Engineer Pen Test

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.