diff options
author | AlburIvan <albur.ivan@outlook.com> | 2018-10-28 03:00:26 -0400 |
---|---|---|
committer | AlburIvan <albur.ivan@outlook.com> | 2018-10-28 03:00:26 -0400 |
commit | df0a0fa2a6ea1b818e3c6aaa139f77fde41f0256 (patch) | |
tree | c912eebef5bf5bfd45d4c2b6c91f355157041de8 /c++.html.markdown | |
parent | 73b8cd9a39ab9b63dd5e2c1c123c363fd014753a (diff) | |
parent | 27fa7c50ce23def736a69711f827918acc726e37 (diff) |
Merge branch 'master' of github.com:adambard/learnxinyminutes-docs into matlab-es
Diffstat (limited to 'c++.html.markdown')
-rw-r--r-- | c++.html.markdown | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/c++.html.markdown b/c++.html.markdown index 8d1c7a26..4113d5f4 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -71,10 +71,16 @@ void func(); // function which may accept any number of arguments // Use nullptr instead of NULL in C++ int* ip = nullptr; -// C standard headers are available in C++, -// but are prefixed with "c" and have no .h suffix. +// C standard headers are available in C++. +// C headers end in .h, while +// C++ headers are prefixed with "c" and have no ".h" suffix. + +// The C++ standard version: #include <cstdio> +//The C standard version: +#include <stdio.h> + int main() { printf("Hello, world!\n"); @@ -1051,6 +1057,8 @@ cout << ST.size(); // will print the size of set ST // Output: 0 // NOTE: for duplicate elements we can use multiset +// NOTE: For hash sets, use unordered_set. They are more efficient but +// do not preserve order. unordered_set is available since C++11 // Map // Maps store elements formed by a combination of a key value @@ -1078,6 +1086,8 @@ cout << it->second; // Output: 26 +// NOTE: For hash maps, use unordered_map. They are more efficient but do +// not preserve order. unordered_map is available since C++11. /////////////////////////////////// // Logical and Bitwise operators @@ -1127,7 +1137,6 @@ compl 4 // Performs a bitwise not ``` Further Reading: -An up-to-date language reference can be found at -<http://cppreference.com/w/cpp> - -Additional resources may be found at <http://cplusplus.com> +* An up-to-date language reference can be found at [CPP Reference](http://cppreference.com/w/cpp). +* Additional resources may be found at [CPlusPlus](http://cplusplus.com). +* A tutorial covering basics of language and setting up coding environment is available at [TheChernoProject - C++](https://www.youtube.com/playlist?list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb). |