C C + + OC iOS interview focus issue (i)

Source: Internet
Author: User

c C + + OC iOS interview focus issue (i)1. String constants need to be added to

2, logical Operation bit operation (Classic: Achieve two number of exchanges)

3. Key words

4. Differences and linkages between references and pointers

5. How do I reference a global variable that has already been defined?

A: You can use the method of referring to the header file, you can also use the extern keyword, if you use a reference header file to refer to a global variable declared in the header file, if you write the variable is wrong, then the compilation will be an error, if you use the Extern method, assuming you made the same mistake, There will be no error during compilation and an error during connection.

5, the use of the extern keyword?

A: extern can be placed before a variable or function to represent the definition of a variable or function in another file, prompting the compiler to look for its definition in other modules when encountering this variable and function. In addition, extern can also be used to specify links.

6.What is the problem with the statement for (; 1;)? What does it mean?   

A: The same as while (1) is a dead loop.

7. please write out the output 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: 10,12,120, 13

6. BOOL has no C + + in C?

A: C language does not have bool (Boolean) Type C + + in the introduction of bool Type C language inside with a value of 0 for false, not 0 integer representation true (generally 1)

7. Escape character

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

Answer: Yes, the local will block the overall. To use global variables, you need to use "::". Local variables can have the same name as global variables, and when referenced within a function, local variables of the same name are used instead of global variables

10. Cyclic dead Cycle

11, function value, change the value inside the function is a pointer to the pointer or reference

12. Data out of bounds

13, algorithm: string splicing, copy, and so on two number transformation, bubble sort, fast sorting

14, linked list, the data of the linked list is not physically adjacent but the logic above is adjacent.

Binary tree, pre-order sequencing

1, a large number of random access data with an array, a large number of insertions and deletions with the linked list. Insert delete operation for linked list? Two-pronged tree?

2, the characteristics of the queue, advanced first out?

3. What are the usage of const?

4, the use of static? Static global static local initialization once? If you define a static variable in the middle of a function

OC IOS

1, function Signature: That is, function name function has a lot of formal parameters when what to do?

2, automatic release of the role of the pool?

3. What is the difference between garbage collection and reference counting? The reference count is 0 before releasing

4, C + + multiple and multilayer, OC is?

5. What is the difference between a macro and a constant? Inline function Interview Question: Write a macro difference is basically: inline do type judgment, type of troop return wrong or do type conversion, but macro does not do type judgment, error prone, + +

6, QQ is how to implement the drop-down list?

7. What is the difference between layers and uiview?

A: The biggest difference between the two is that the layer does not render directly 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 entirely by coreanimation to achieve it. The real drawing part of it is managed by a Calayer class. The UIView itself is more like a Calayer manager. A uiview can have n calayer, each layer shows a kind of thing, enhance UIView's ability of presentation.

8, the role of the Commission? The delegate is also a design pattern there is a dedicated module to complete a function that allows another module to complete another function asynchronously, if completed can be done by the callback function to do the following

It's best to write a delegate yourself.

9, in order to let the project manager understand your code can write your ideas. 1 2 3 are listed on the paper. If you write code on paper, you can simulate the execution of the machine in addition to writing the code.

    • How to use code to implement the iphone software logout and phone restart
    • Next article NSString setstring usage: Complete replacement

C C + + OC iOS interview focus issue (i)

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.