From 2242ad7a1796bf3c9e25a0ec977620c05ac15c58 Mon Sep 17 00:00:00 2001 From: Apoorv Choubey Date: Sat, 13 Oct 2018 22:28:57 +0530 Subject: add C++ resource --- c++.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'c++.html.markdown') diff --git a/c++.html.markdown b/c++.html.markdown index 8d1c7a26..579aabf5 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -1131,3 +1131,5 @@ An up-to-date language reference can be found at Additional resources may be found at + +A tutorial covering basics of language and setting up coding environment is available at [TheChernoProject - C++](https://www.youtube.com/playlist?list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb). -- cgit v1.2.3 From 5117208ead0482ff93ee40474be7f479b880ff7f Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Sun, 14 Oct 2018 05:26:21 +0530 Subject: Fix links and list styling --- c++.html.markdown | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'c++.html.markdown') diff --git a/c++.html.markdown b/c++.html.markdown index 579aabf5..9d6470be 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -1127,9 +1127,6 @@ compl 4 // Performs a bitwise not ``` Further Reading: -An up-to-date language reference can be found at - - -Additional resources may be found at - -A tutorial covering basics of language and setting up coding environment is available at [TheChernoProject - C++](https://www.youtube.com/playlist?list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb). +* 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). -- cgit v1.2.3 From 3cfb769bfbc42f5e4236401707913f6725a3070c Mon Sep 17 00:00:00 2001 From: Matthew Biondi Date: Thu, 18 Oct 2018 12:26:26 -0400 Subject: Addresses #3009, corrects C++ headers description --- c++.html.markdown | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'c++.html.markdown') diff --git a/c++.html.markdown b/c++.html.markdown index 9d6470be..8be5a278 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 +//The C standard version: +#include + int main() { printf("Hello, world!\n"); -- cgit v1.2.3 From 129abf6113a48f928b5b8b47a54ff60184947cea Mon Sep 17 00:00:00 2001 From: Ankush Agarwal Date: Mon, 22 Oct 2018 08:44:21 -0700 Subject: Add comments about unordered_map and unordered_set --- c++.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'c++.html.markdown') diff --git a/c++.html.markdown b/c++.html.markdown index 8be5a278..f1ad0790 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -1027,6 +1027,7 @@ for (it = my_vector.begin(); it != my_vector.end(); ++it) { // Set // Sets are containers that store unique elements following a specific order. +// For hash sets, use unordered_set. They are more effecient but do not preserve order. // Set is a very useful container to store unique values in sorted order // without any other functions or code. @@ -1061,6 +1062,7 @@ cout << ST.size(); // will print the size of set ST // Map // Maps store elements formed by a combination of a key value // and a mapped value, following a specific order. +// For hash maps, use unordered_map. They are more effecient but do not preserve order. #include map mymap; // Will initialize the map with key as char and value as int -- cgit v1.2.3 From 2e6208c754becae469c4056ac9ecdea40f490064 Mon Sep 17 00:00:00 2001 From: Ankush Agarwal Date: Mon, 22 Oct 2018 09:12:29 -0700 Subject: Update comments --- c++.html.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'c++.html.markdown') diff --git a/c++.html.markdown b/c++.html.markdown index f1ad0790..225472cb 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -1027,7 +1027,6 @@ for (it = my_vector.begin(); it != my_vector.end(); ++it) { // Set // Sets are containers that store unique elements following a specific order. -// For hash sets, use unordered_set. They are more effecient but do not preserve order. // Set is a very useful container to store unique values in sorted order // without any other functions or code. @@ -1058,11 +1057,12 @@ 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 effecient but +// do not preserve order. unordered_set is available since C++11 // Map // Maps store elements formed by a combination of a key value // and a mapped value, following a specific order. -// For hash maps, use unordered_map. They are more effecient but do not preserve order. #include map mymap; // Will initialize the map with key as char and value as int @@ -1086,6 +1086,8 @@ cout << it->second; // Output: 26 +// NOTE: For hash maps, use unordered_map. They are more effecient but do +// not preserve order. unordered_map is available since C++11. /////////////////////////////////// // Logical and Bitwise operators -- cgit v1.2.3 From 00bb4b8a70f4ddd09ce4243e817fba2c489646da Mon Sep 17 00:00:00 2001 From: Ankush Agarwal Date: Mon, 22 Oct 2018 14:13:58 -0700 Subject: efficient typo fix --- c++.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c++.html.markdown') diff --git a/c++.html.markdown b/c++.html.markdown index 225472cb..4113d5f4 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -1057,7 +1057,7 @@ 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 effecient but +// NOTE: For hash sets, use unordered_set. They are more efficient but // do not preserve order. unordered_set is available since C++11 // Map @@ -1086,7 +1086,7 @@ cout << it->second; // Output: 26 -// NOTE: For hash maps, use unordered_map. They are more effecient but do +// NOTE: For hash maps, use unordered_map. They are more efficient but do // not preserve order. unordered_map is available since C++11. /////////////////////////////////// -- cgit v1.2.3