C ++ oc ios interview key questions (1)

Source: Internet
Author: User

1. Add \ 0 to the String constant

2. logical bitwise operations (classic: implements the exchange of two numbers)

3. Keywords

4. Differences and relationships between references and pointers

5,How to reference a defined global variable?

A: You can use the header file reference method or the extern keyword. If you use the header file reference method to reference a global variable declared in the header file, suppose you have written the variable wrong, an error will be reported during compilation. If you reference it using the extern method, if you make the same mistake, no error will be reported during compilation, but an error will be reported during connection.

5. How to Use the extern keyword?

A: extern can be placed before a variable or function to indicate that the definition of a variable or function is in another file, prompting the compiler to find its definition in other modules when it encounters this variable or function. In addition, extern can be used to specify links.

6What are the issues with the for (; 1;) statement? What does it mean?  

A: The same as while (1) is an endless loop.

7,Write the output content of the following code

# Include <stdio. h> main () {int A, B, C, D; A = 10; B = A ++; C = ++ A; D = 10 * A ++;
Printf ("B, c, d, A: % d, % d, % d", B, c, d, a); Return 0;
} Answer: 120, 13

6. Is bool available in C without C ++?

A: in C language, bool (Boolean) Type C ++ is not introduced. in C language, bool type C is used. The value 0 indicates false, and a non-0 integer indicates true (generally 1)

7. escape characters

9. Can global variables and local variables have the same name?

A: Yes. Global blocking will be performed in some cases. To use global variables, you must use "::". A local variable can have the same name as a global variable. A local variable with the same name is used when this variable is referenced in a function, instead of a global variable.

10. endless loop

11. When a function transfers a value, the internal function changes the value by using a pointer or reference

12. Data Out of bounds

13. algorithm: String concatenation, copying, and so on. Bubble sorting and quick sorting

14. The linked list data is physically not necessarily adjacent but logically adjacent.

Binary Tree, forward, middle, and backward

1. A large number of random accesses to data using arrays. If a large number of inserts and deletes are used, a linked list is used. Insert or delete a linked list? Binary Tree?

2. What are the features of queues?

3. What are the usage of const?

4. Static usage? Static Global static local initialization once? If a static variable is defined in the middle of a function


OC IOS

1. Function Signature: What should I do when the function name has many parameters?

2. What is the function of automatically releasing a pool?

3. What is the difference between garbage collection and reference counting? Release only when the reference count is 0

4. There are multiple and multi-layers in C ++, and what is in oc?

5. What is the difference between macros and constants? Inline Function interview questions: Write a macro. The differences are roughly as follows: inline performs type judgment, Type Army reports an error or type conversion, but the macro does not perform type judgment and is prone to errors, ++

6. How does QQ implement a drop-down list?

7. What is the difference between layer and uiview?

A: The biggest difference between the two is that layers are not directly rendered to the screen. uiview is the basis of the interface elements in the IOS system, and all the interface elements are inherited from it. It is fully implemented by coreanimation. The real plot is managed by a calayer class. Uiview itself is more like a calayer manager. A uiview can have n calayers. Each layer displays one thing, enhancing the uiview display capability.

8. What is the role of delegation? Delegation is also a design pattern. There is a dedicated module to complete one function, so that another module can complete another function asynchronously. If so, you can perform the following operations through the callback function.

It is best to write a delegate by yourself.


9. To help the project manager understand your code, write your ideas. 1, 2, and 3 columns are written on paper. If you want to write code on paper, you can simulate the machine's execution steps in addition to writing code.

Related Article

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.