Wednesday, November 18, 2009

Chapter 2. Getting Started Quickly: A Brief Overview of C++




I l@ve RuBoard

Chapter
2. Getting Started Quickly: A Brief Overview of C++






Topics in this Chapter








  • The Basic Program Structure






  • Preprocessor Directives






  • Comments






  • Declarations and Definitions






  • Statements and Expressions






  • Functions and Function Calls






  • Classes






  • Dealing with Program Development Tools






  • Summary






In this chapter, I will briefly preview the basic programming constructs of the C++ language before going on to discuss them in more depth in the chapters that follow. Because C++ is a large language, anything that is "brief" is not going to cover much of the language, and anything that indeed reviews the most important features of the language is not going to be "brief." I will try to strike a reasonable compromise.



Studying a language like C++ feature by feature cannot give you a general picture that would connect different features into a cohesive whole. Many features are intertwined and cannot be discussed separately. This is why you need this preview. It will give you the first look at the most important concepts and constructs of the C++ language, will enable you to write your first C++ programs, and will prepare you for studying these concepts and techniques in depth and in breadth.



The programs in this book are written using the ISO/ANSI standard C++. This version of the language adds new features and also changes the syntax of some existing features. There are still many compilers in use in industry that implement only some features of the new language. There are too many different vendors and too many different compiler versions to discuss their differences in implementing standard C++ in detail. Eventually, older compilers will be replaced by newer versions. However, the industry will have to deal with the code written in prestandard C++ for many years to come. This old code will be supported by newer compilers as well, because backward compatibility is one of the important goals of C++ design, and standard C++ adds new features without making old features illegal. As a rule, I will cover new standard C++ syntax without mentioning that explicitly. Where necessary, I will make reference to older ways of writing code to make sure you can deal with legacy code with confidence.







I l@ve RuBoard

No comments: