= [Note] =
Programming Language is just a tool for us to communicate with computers and let computers realize our creative ideas. It can and encourages us to gain an in-depth understanding of a language, but never indulge in the tip of a language, be sure to grasp the degree between the two
This post is occasionally serialized, and provides a basic question in the form of a test paper for your consideration and discussion. The analysis of the question will be provided in the next updated post, in this case, I hope that my friends who are not clear about the problem will have time to think about and discuss it. I hope you can get some insights from these posts.
The problem in the post is some of the syntax or relatively obscure program problems I encountered during my study of C \ C ++. I have my own summary, there are also some classic resolutions found on the Internet. I would like to share them with you and hope they can play a leading role.
If you find any problems during reading, please notify me in time and I will correct them in time to avoid misleading everyone. Thank you very much ^_^
[No.1 difference between the sizeof keyword and strlen in determining the length of a C string]
[Question No. 1]
Enter the values of the following expressions in sequence (values: errors and uncertain values ):
Copy content to clipboard
Code:
Char * str_1 = "12345 ";
Char str_2 [] = "12345 ";
Char str_3 [5] = {'1 '};
Char str_4 [5] = {'1', '2', '3', '4', '5 '};
Expression value
Sizeof (str_1 )________
Sizeof (* str_1 )________
Strlen (str_1 )________
Sizeof (str_2 )________
Strlen (str_2 )________
Sizeof (str_3 )________
Strlen (str_3 )________
Sizeof (str_4 )________
Strlen (str_4 )________
Strlen (* str_1 )________
If you have any questions, please feel free to come here for discussion and exchange, and learn and make progress together.
This article is from the "Bill_Hoo" blog