C++ Primer Part I

Part I: The Basics

Every programming language provides common features ?

  • Built-in types such as integers, characters, and so forth
  • Variables, which let us give names to the objects we use
  • Expressions and statements to manipulate values of these types
  • Control structures, such as if or while, that allow us to conditionally or
    repeatedly execute a set of actions
  • Functions that let us define callable units of computation
  • But hey differ in detail from one language to another.

Most programming languages supplement these basic features in which two ways ?

  • They let programmers extend the language by defining their own types/data structure, and they provide
    library routines that define useful functions and types not otherwise built into the
    language.

C++ Types features ?

  • the type of an object determines what operations can be performed on it. Some languages, such as Smalltalk and Python, check types at run time. In contrast, C++ is a statically typed language; type
    checking is done at compile time. As a consequence, the compiler must know the type of every name used in the program.

  • C++ provides a set of built-in types, operators to manipulate those types, and a small set of statements for program flow control. These elements form an alphabet from which we can write large, complicated, real-world systems. At this basic level, C++ is a simple language.

  • Its expressive power arises from its support for mechanisms that allow the programmer to define new data structures/types (mostly the class. sometimes we calle “class types” to distinguish them from the built-in type. C++, allow programmers to define types/class types that include operations as well as data.The Standard C++ library uses these features to implement a rich library of class types and associated functions.).

Why c++ supports mechanisms that allow the programmer to define new data structures.?

  • Using these facilities, programmers can shape the language to their own purposes without the
    language designers having to anticipate the programmers’ needs.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值