C++ programming Exercises practice with solution
What is C++ Programming Language?
C++ is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation.
It was designed with a bias toward system programming and embedded, resource-constrained and large systems, with performance, efficiency and flexibility of use as its design highlights. Many vendors provide C++ compilers, including the Free Software Foundation, Microsoft, Intel, and IBM.
The best way we learn anything is by practice and exercise questions. We have started this section for those (beginner to intermediate) who are familiar with C++ programming.
Hope, these exercises help you to improve your C++ programming coding skills. Currently, following sections are available, we are working hard to add more exercises .... Happy Coding!
List of C++ Exercises
- Basic Exercises: 86 Exercises with Solution
- Basic Algorithm Exercises: 117 Exercises with Solution
- For Loop Exercises: 87 Exercises with Solution
- Date Exercises: 6 Exercises with Solution
- String Exercises: 32 Exercises with Solution
- Array Exercises: 30 Exercises with Solution
- Vector Exercises: 6 Exercises with Solution
- Math Exercises: 31 Exercises with Solution
- Numbers: 46 Exercises with Solution
- Sorting and Searching: 14 Exercises with Solution
- More ....
More to Come !
Popularity of Programming Language Worldwide, Oct 2022 compared to a year ago:
|1||Python||28.3 %||-1.8 %|
|2||Java||17.2 %||-0.9 %|
|5||C/C++||6.45 %||-0.4 %|
|6||PHP||5.39 %||-0.9 %|
|7||R||4.03 %||+0.3 %|
|8||TypeScript||2.17 %||+1.1 %|
|9||Objective-C||2.16 %||+0.2 %|
|12||Kotlin||1.81 %||+0.1 %|
|13||Rust||1.57 %||+0.8 %|
|14||Matlab||1.52 %||+0.1 %|
|16||VBA||0.96 %||-0.3 %|
|17||Scala||0.78 %||+0.3 %|
|18||Ada||0.76 %||+0.2 %|
|19||Dart||0.75 %||+0.1 %|
|20||Visual Basic||0.64 %||-0.2 %|
|21||Lua||0.61 %||+0.2 %|
|22||Abap||0.48 %||-0.1 %|
|23||Groovy||0.44 %||-0.1 %|
|24||Cobol||0.32 %||-0.0 %|
|25||Julia||0.28 %||-0.1 %|
|26||Perl||0.28 %||-0.1 %|
|27||Haskell||0.28 %||+0.0 %|
|28||Delphi/Pascal||0.14 %||+0.1 %|
Source : https://pypl.github.io/PYPL.html
TIOBE Index for September 2022
|Sep 2022||Sep 2021||Change||Programming Language||Ratings||Change|
|17||11||Classic Visual Basic||0.98%||-0.55%|
Source : https://www.tiobe.com/tiobe-index/
C++ Programming: Tips of the Day
What is a smart pointer and when should I use one?
This answer is rather old, and so describes what was 'good' at the time, which was smart pointers provided by the Boost library. Since C++11, the standard library has provided sufficient smart pointers types, and so you should favour the use of std::unique_ptr, std::shared_ptr and std::weak_ptr.
There was also std::auto_ptr. It was very much like a scoped pointer, except that it also had the "special" dangerous ability to be copied - which also unexpectedly transfers ownership.
It was deprecated in C++11 and removed in C++17, so you shouldn't use it.
std::auto_ptr<MyObject> p1 (new MyObject()); std::auto_ptr<MyObject> p2 = p1; // Copy and transfer ownership. // p1 gets set to empty! p2->DoSomething(); // Works. p1->DoSomething(); // Oh oh. Hopefully raises some NULL pointer exception.
Ref : https://bit.ly/3mc9GHE
- Exercises: Weekly Top 16 Most Popular Topics
- SQL Exercises, Practice, Solution - JOINS
- SQL Exercises, Practice, Solution - SUBQUERIES
- Java Array: Exercises, Practice, Solution
- C Programming Exercises, Practice, Solution : Conditional Statement
- HR Database - SORT FILTER: Exercises, Practice, Solution
- C Programming Exercises, Practice, Solution : String
- Python Data Types: Dictionary - Exercises, Practice, Solution
- Python Programming Puzzles - Exercises, Practice, Solution
- C++ Array: Exercises, Practice, Solution
- C# Sharp Basic Algorithm: Exercises, Practice, Solution
- Python Lambda - Exercises, Practice, Solution
- Python Pandas DataFrame: Exercises, Practice, Solution
- Conversion Tools