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

C and C++ Manual with Code Examples

C and C++ are two of the most important programming languages today. Many professional programmers are proficient in C and 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. 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.

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. 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. 

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. 

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:
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. 

Numeric algorithms: Perform numeric calculations on the contents of containers. These category includes:
accumulate, adjacent_difference, inner_product, iota, partial_sum, power. 


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. When they are dereferenced, iterators yield a reference to a container element. In addition, they can be compared to each other for equality or inequality.

Iterators interact seamlessly with built-in C++ types. In particular, native C++ pointers are treated as iterators to C++ arrays. Naturally, all containers in the Standard C++ Library define an iterator type, i.e., a nested type iterator that represent their respective pointer-like type.

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:

  • input iterators
  • output iterators
  • forward iterators
  • bidirectional iterators
  • random access iterators

An iterator category is an abstraction. It represents a set of requirements to an iterator.


STL

The Standard Template Library is a new C++ library that provides a set of easily composable C++ container classes and generic algorithms (template functions).

The container classes include vectors, lists, deques, sets, multisets, maps, multimaps, stacks, queues and priority queues.

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. 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++.


String

C++ supports characters strings two ways. The first is as a null-terminated character array. This is sometimes referred to as a C string. The second way is as a class object of type basic_string. The basic_string class is essentially a container. this means that iterators and the STL algorithms can operate on string. However, string has additional capabilities.

C++ string recognizes operators:
<, <=, >, >=, ==, !=, =, += .
When you use template functions, or classes you don't need to write addition function with strcpy, ctrcmp of ctrcat... In this case C++ string works like any of built-in data type.

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.

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.


More C Programming Examples and Help

Stdio Functions


String Functions

Time Functions

Technorati Tags: , , , , , , , ,

Popularity: 35% [?]

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
  • Free PC Intro book
  • C# Fast and Easy Web Development
  • Linux and Unix Workshop Tutorials, Guides, and Manuals
  • dotNet, Access, SQL Server and Database Design Tutorials


  • Filed under: Best New Free Computer IT Training Tutorial Resources — computer_teacher @ 12:51 am

    No Comments »

    No comments yet.

    RSS feed for comments on this post.

    Leave a comment

    You must be logged in to post a comment.



    Powered by WordPress