I only record some of the answers that are more informative and will be improved later. I hope you can give me some wonderful answers. Thank you!
1: What is the size-end mode? Use the macro-real-size-end mode to read and write data.
See http://blog.csdn.net/ce123/article/details/6971544
2: Compare the advantages and disadvantages of the for loop in the following two modes, and how to optimize
For (I = 0; I <n; I ++) {If (condition) dosomething (); elsedootherthing ();}
Advantage: simple and easy to understand
Disadvantages: each cycle should be a if judgment, so compared to the following method at least more N-1 if judgment, and if judgment interrupted the for loop pipeline operation, low efficiency
If (condition) {for (I = 0; I <n; I ++) dosomething () ;}else {for (I = 0; I <n; I ++) dootherthing ();}
Disadvantages: complicated writing and hard to read
Advantage: higher efficiency than above
3:CodeAre there any errors or results?
# Define Max 255 unsign char a [Max], I; for (I = 0; I <Max; I ++) A [I] = I;
4: The use of sizeof, specifically what do not remember, but the main test is sizeof pointer and array evaluate
5: Implement strcmp library functions by yourself
During the interview, I wrote one by myself and thought it was okay (if the two strings used for comparison do not end with '\ 0 ',Program):
Int strcmp (const char * str1, const char * str2) {While (str1 & str2 & (* str1 ++ = * str2 ++ )); return (* str1)-(* str2 );}
After reading the definition of this function in window, I feel a little complicated. I don't know any bugs above. Please refer to me for correction.
6. Use WinSock to implement a simple client server program
For a person who has never been taller than window C, this is really not. I only know that socket is enough. I believe it should be very simple for those who are engaged in windows.
7: Write the if statement for bool, float, and pointer comparison with "zero value ".
Reference: http://blog.csdn.net/jhg1204/article/details/8980186