In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the grammar knowledge points of C++". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought slowly and deeply. Let's study and learn what are the grammar points of C++!
The composition of C++ program
(1) preprocessing command
Start with #. Three types of preprocessing commands.
A macro defines commands.
The B file contains commands.
C conditional compilation command.
(2) statement
(3) input and output
(4) variables
(5) function
Language symbol
In C++ grammar, the basic element recognized by the compiler is the "language symbol", and a language symbol is the source program text that the compiler cannot divide into components.
Language symbols include: keywords, identifiers, constants, string text, operators, punctuation characters.
White space character
Space, tabbing, line feeds, carriage returns, page feeds, vertical tabulation (vertical tab), and line feeds (newline) characters are all called white space characters (white-space) because they have the same function. That is, as the space between the words and lines on the printed page, making it easier to read. Language symbols are delimited by white space characters and other language symbols, such as operators and punctuation.
When performing lexical analysis of code, the C++ compiler ignores white space characters unless they are used as delimiters or as components of character constants or string text. Use white space characters to make the program more readable. Note that the compiler also treats comments as white space characters.
First of all, repeat Bjarne's words: "our system is already extremely complex, in order to avoid the complexity of C++, simply do not use C++ (Linus approach), is tantamount to giving up eating for fear of choking." C++ is a better language than C in all the areas where C and C++ are available. When I say "better," I'm saying that C++ has safer type checking, better abstraction mechanisms, and better libraries than C.
Of course, there are exceptions to everything, if you do project 1) not big. 2) there is no abstract mechanism in coding, not even ADT (abstract data types, such as std::complex, which does not contain polymorphism and inheritance), RAII, and exceptions. 3) you don't even need basic libraries (such as smart pointers and smart containers that simplify resource management).
Then maybe it's okay for you to use C; so if that's your case, don't argue with me, because I can't refute you. The areas we are talking about here are roughly those that Bjarne listed in the list of C++ apps. The bottom line is: if you get rid of many unnecessary complexities in C++, leave those essential and important language features, simplify the language model, and eliminate the historical burden.
Even opponents of C++ grammar may find it hard to find a reason to say, "I still don't use C++." In my opinion, a person who is really rationally opposed to using C++ in a practical sense has only one reason: the confusion caused by C++ 's complexity offsets or even outweighs the benefits of C++ 's abstract mechanisms and libraries (in his particular project).
It is worth noting that there is a trap to be avoided here, that is, once people decide that "C++ is bad", then this reason will "grow their own feet", that is, even if we remove the complexity of C++, they may also insist on not using C++ grammar and find a bunch of reasons for it.
I assume you're not like that. However, perhaps the most likely thing is that he will say: "the problem is that the C++ we use today is not so (concise), and your hypothesis is not valid." Yes, my hypothesis is not valid. But although we cannot eliminate complexity, we can actually easily avoid complexity and avoid weaknesses and strengths.
Thank you for your reading. The above is the content of "what are the grammar knowledge points of C++". After the study of this article, I believe you have a deeper understanding of what are the grammar knowledge points of C++. The specific use also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 212
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.