Intelligentedu intelligentedu
Best New Free Computer IT Training Tutorial Resources 最佳新免费电脑的资讯科技培训,补习资源
Translate to EnglishÜbersetzen Sie zum Deutsch/GermanTraduzca al Español/SpanishTraduisez au Français/FrenchTraduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese
한국어에게 번역하십시오/Korean中文翻译/Chinese Simplified中文翻译/Chinese Traditionalترجمة الى العربية/ArabicVertaal aan het Nederlands/DutchΜεταφράστε στα ελληνικά/GreekПереведите к русскому/Russian





Blog Roll: 博客滚动:


Top Links: 顶部链接:

November 10, 2006 2006年11月10日

C and C++ Manual with Code Examples C和C + +手册与代码范例

C and C++ are two of the most important programming languages today. C和C + +是两个最重要的编程语言的今天。 Many professional programmers are proficient in C and C++.很多专业的编程人员正在熟练,在C和C + + 。 These two programming languages are the foundation upon which modern programming is built.这两个编程语言是基础,现代编程的基础。

The C language was invented by Dennis Ritchie in the 1970s. C语言发明丹尼斯瑞奇在20世纪70年代。 It is a middle-level language and combines the control structures of a high-level language with the ability to manipulate bits, bytes, and pointers, or addresses.这是一个中级语言和相结合的控制结构的一个高层次的语言能力操纵位,字节,和指针,或地址。 C provides a programmer virtually complete control over the computer. c程序员提供了一个几乎完全控制电脑。

This web site, the C / C++ Zone, is not designed as a tutorial, but rather as a C and C++ programming manual with usable code examples .这个网站,炭/炭+区,是不是设计作为一个补习,而是作为一个C和C + +编程手册与实用代码范例 It is under constant development.这是根据不断发展。



C / C++ Zone 炭/炭+区


Algorithms 算法

The generic algorithms fall into four categories, as listed here:通用算法分为四类,由于上市在这里:

Non-modifying sequence algorithms: Do not modify the containers on which they work. 非修改序列算法:不要修改容器对他们的工作。 Such algorithms include:这种算法包括:
adjacent_find, find, find_end, find_first, count, mismatch, equal, for_each, search. adjacent_find ,查找, find_end , find_first ,计数,错配,平等, for_each ,搜索。

Mutating sequence algorithms: Modify the containers on which they work. 变异序列算法:修改容器对他们的工作。 Such algorithms include:这种算法包括:
copy_backward, fill, generate, partition, random_shuffle, remove, replace, rotate, reverse, swap, swap_ranges, transform, unique. copy_backward ,填写,生成,分割, random_shuffle ,删除,替换,旋转,扭转,交换, swap_ranges ,变换,独特的。

Sorting algorithms: Sort the contents of containers in various ways. 排序算法:排序的内容的容器以各种方式。 These algorithms include:这些算法包括:
sort, stable_sort, partial_sort, partial_sort_copy, as well as a number of related functions, including:排序, stable_sort , partial_sort , partial_sort_copy ,以及一些相关的功能,包括:
nth_element, binary_search, lower_bound, upper_bound, equal_range, merge, includes, push_heap, pop_heap, make_heap, sort_heap, set_union, set_intersection, set_difference, set_symmetric_difference, min, min_element, max, max_element, lexicographical_compare, next_permutation, prev_permutation. nth_element , binary_search , lower_bound , upper_bound , equal_range ,合并,其中包括, push_heap , pop_heap , make_heap , sort_heap , set_union , set_intersection , set_difference , set_symmetric_difference ,闽, min_element ,最大, max_element , lexicographical_compare , next_permutation , prev_permutation 。

Numeric algorithms: Perform numeric calculations on the contents of containers. 数值算法:执行的数值计算,就其内容的容器。 These category includes:这些类别包括:
accumulate, adjacent_difference, inner_product, iota, partial_sum, power.积累, adjacent_difference , inner_product ,丝毫, partial_sum ,电力。


Iterators 迭代

Iterators are pointer-like objects that allow programs to step through the elements of a container sequentially without exposing the underlying representation.迭代器是指针般的物体,让程序一步,通过要素的一个货柜,比上一季度没有揭露背后的代表性。 Iterators can be advanced from one element to the next by incrementing them.迭代可以从先进的一个要素,到下一个由递增。 Some iterators can also be decremented or allow arbitrary jumps from one element to another, as we will see later.一些迭代器也可以decremented或允许任意跳跃,从一元到另一个,因为我们将看到更高版本。 When they are dereferenced, iterators yield a reference to a container element.当他们dereferenced ,迭代收益率的参考,以一个货柜的元素。 In addition, they can be compared to each other for equality or inequality.此外,他们还可以相比,对方为平等或不平等。

Iterators interact seamlessly with built-in C++ types.迭代互动,无缝内置在C + +类型。 In particular, native C++ pointers are treated as iterators to C++ arrays.特别是,本土的C + +指针被视为迭代到C + +阵列。 Naturally, all containers in the Standard C++ Library define an iterator type, ie, a nested type iterator that represent their respective pointer-like type.当然,所有容器在标准的C + +库定义一个迭代型,即嵌套类型迭代代表各自的指针样型。

Iterator Categories Iterators fall into categories. 迭代类迭代陷入类别。 This is because different algorithms impose different requirements on an iterator they use.这是因为不同的算法施加不同的要求,一迭代他们使用。 For example, the find() algorithms needs an iterator that can be advanced by incrementing it, whereas the reverse() algorithm needs an iterator that can be decremented as well, etc. Ultimately, there are five categories of iterators in STL and Standard C++ Library:举例来说,找到( )算法需要一个迭代可以通过先进的递增,而反向( )算法需要一个迭代可以decremented以及等,最终有5个类别的迭代器在STL和标准的C + +图书馆:

  • input iterators输入迭代
  • output iterators输出迭代
  • forward iterators向前迭代
  • bidirectional iterators双向迭代
  • random access iterators随机存取迭代

An iterator category is an abstraction. 1迭代类是一个抽象的。 It represents a set of requirements to an iterator.它代表了一套规定,以一迭代。


STL 明光社

The S tandard T emplate L ibrary is a new C++ library that provides a set of easily composable C++ container classes and generic algorithms (template functions).S tandard emplate ibrary是一种新的C + +库提供了一套容易组合的C + +集装箱班和遗传算法(范本职能) 。

The container classes include vectors, lists, deques, sets, multisets, maps, multimaps, stacks, queues and priority queues. 集装箱班,包括向量,清单, deques ,集, multisets ,地图, multimaps ,栈,队列和优先级队列。

The generic algorithms include a broad range of fundamental algorithms for the most common kinds of data manipulations, such as searching, sorting, merging, copying, and transforming. 通用算法 ,包括范围广泛的基本算法是最常见的种数据操作,如搜索,整理,合并,复制,和转化。

At its July 1994 meeting, the ANSI/ISO C++ Standards Committee voted to adopt STL as part of the standard C++ library.在其1994年7月一次会议上,美国ANSI /国际标准化组织的C + +标准委员会表决通过的STL的一部分,该标准的C + +库。 The STL proposal to the committee by Alex Stepanov and Meng Lee of Hewlett-Packard Labs was based on research on generic programming and generic software libraries that Stepanov, Lee, and David Musser have been working on for several years, in Scheme, Ada, and C++.有关STL的建议,该委员会由Alex stepanov和孟李惠普公司实验室是研究的基础上对通用编程和通用软件图书馆stepanov ,李,朱musser已经工作了数年,在计划,反倾销协定,并C + +中。


String 字符串

C++ supports characters strings two ways. C + +的支持字符字符串两种方式。 The first is as a null-terminated character array.首先是作为一个Null终结的字符数组。 This is sometimes referred to as a C string.这是有时被称为一个C字符串。 The second way is as a class object of type basic_string.第二种方法是作为一类类型的对象basic_string 。 The basic_string class is essentially a container.该basic_string阶层基本上是一个货柜。 this means that iterators and the STL algorithms can operate on string.这意味着,迭代和STL的算法可以运作的字串。 However, string has additional capabilities.不过,字符串有额外的能力。

C++ string recognizes operators: <, <=, >, >=, ==, !=, =, += . C + +中字符串的经营者认识到: < , < = , > , > = , == , ! = , = , + = 。
When you use template functions, or classes you don't need to write addition function with strcpy, ctrcmp of ctrcat...当您使用的模板功能,或班级,您不必写,除了功能与strcpy , ctrcmp的ctrcat ... In this case C++ string works like any of built-in data type.在这种情况下的C + +字符串工程一样,任何的内置的数据类型。

String functions .C++ string, like any of container classes, has its own public functions, that add a lot of flexibility for manipulation of C++ string data type. 字符串函数 。 C + +的字符串,如同任何集装箱班,有自己的公共职能,即添加一个很大的弹性,为操纵的C + +字符串数据类型。

Overflowing. 满溢。
You don't need to think about overflowing or null-terminating character.你不需要想满溢或空终止字符。 C++ string allows use sequence of characters as long as allows ability of your OS. C + +的字符串允许使用字符序列,只要允许的能力,您的作业系统。


More C Programming Examples and Help 更多的C语言编程的例子和帮助

Stdio Functions stdio职能


String Functions字符串函数

Time Functions时间函数

Technorati Tags: Technorati标记: , , , , , , , ,

Popularity: 38% [人气: 38 % [ ? ] ]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages. 分享和享受: 这些图标链接到社会书签网站,读者可以分享和发现新的网页。
  • blogmarks
  • del.icio.us
  • Furl
  • Reddit
  • Shadows
  • YahooMyWeb
  • StumbleUpon
  • Digg
Related Posts: 相关文章:
  • MySQL Documentation and Reference Manuals MySQL的文件和参考手册
  • Free PC Intro book免费的PC介绍书
  • C# Fast and Easy Web Development C #中快速且轻松的Web开发
  • Linux and Unix Workshop Tutorials, Guides, and Manuals Linux和Unix讲习班教程,指南,和手册
  • dotNet, Access, SQL Server and Database Design Tutorials dotnet ,存取, SQL Server和数据库设计指南

  • Filed under:提起下: Best New Free Computer IT Training Tutorial Resources最佳新免费电脑的资讯科技培训,补习资源 — computer_teacher @ 12:51 am -c omputer_teacher@上午1 2时5 1分

    No Comments没有评论 »

    No comments yet.没有评论。

    RSS feed for comments on this post. RSS馈送的评论对这个职位。

    Leave a comment留下意见

    You must be您必须 logged in记录在 to post a comment.张贴评论。



    Powered by 动力 WordPress 在WordPress