Welcome to the GitHub repository! Here, you will find all the code and resources related to my Medium articles on practical tips for developers using C++. As a passionate advocate for empowering developers with up-to-date knowledge, I have created this repository to share my insights and expertise with the tech community.
With a focus on practical solutions and real-world examples, my articles cover a wide range of topics related to C++ programming. From mastering the basics to tackling more advanced concepts, I provide tips and guidance to help developers of all skill levels achieve their goals.
So, whether you're a seasoned developer or just starting out, this repository is the perfect place to find valuable resources and insights. Be sure to check out my latest articles on Medium, and don't hesitate to reach out if you have any questions or feedback. Together, let's build a stronger, more empowered tech community!
Connect me on LinkedIn
Please consider subscribing to my YouTube channel.
I recommend reading the C++ FAQ Lite
- Tips
- Computer Science Basics
- Learning Resources
- Problem Solving
- Projects Ideas
# | Title with Medium Article Link | Solution | Comment |
---|---|---|---|
1 | Converting Character to Integer | C++ | This program demonstrates how to convert characters to integers and calculate their sum. |
2 | Input Validation | C++ | This program prompts the user to input a number between 1 and 10, converts the input character to an integer, and checks if it is within the valid range. It then outputs a message indicating whether the input is valid or not. |
3 | Simple Array | C++ | This program demonstrates how to declare and initialize arrays in C++, and how to access their elements using the subscript operator. |
4 | Singly Linked List | C++ | This program demonstrates how to create and traverse a singly linked list using the Node struct, which contains an integer data value and a pointer to the next node in the list. |
5 | Doubly Linked List | C++ | This program demonstrates how to create and traverse a doubly linked list using the Node struct, which contains an integer data value and a pointer to the previous & next node in the list. |
6 | Efficient Square Root | C++ | The program uses binary search to find the square root of a given number and returns the largest integer whose square is less than or equal to the given number. |
7 | 1318. Minimum Flips to Make a OR b Equal to c | C++ | This is a C++ program that calculates the number of flips required to make all bits of three given integers either 0 or 1. |
8 | Passing by Reference and Value | C++ | This is a C++ program that demonstrates the difference between passing a variable by value and by reference. |
9 | Lexicographic Order | C++ | This C++ program demonstrates the usage of lexicographic order by comparing strings and sorting a vector of strings. It also shows how to generate permutations of a vector of integers using the next_permutation function. |
10 | Function Overloading | C++ | This C++ program demonstrates function overloading by defining two functions with the same name calculateArea but different parameter lists to calculate the area of a square and a rectangle. |
11 | Virtual Functions | C++ | This C++ program demonstrates the use of virtual functions to achieve polymorphism in a Shape hierarchy, allowing for different shapes to be drawn using the same function call. |
12 | Types of Inheritance | C++ | This C++ program demonstrates the implementation of polymorphism using virtual functions to calculate the area of a Circle and a Rectangle. |
13 | Abstract Classes and Interfaces | C++ | This is a C++ program that demonstrates the use of abstract classes and interfaces with a Cat class that inherits from the Animal abstract class and implements the Drawable interface. |
14 | Stack and Heap Memory | C++ | This is a C++ program that demonstrates the use of stack and heap memory with functions that allocate variables on the stack and an array on the heap, perform operations on them, and deallocate the heap memory. |
15 | Exception Handling | C++ | This is a C++ program that demonstrates exception handling, throwing a runtime_error with a custom message when dividing by zero, and catching the exception in the main function using a try-catch block. |
16 | Private, Protected, and Public Inheritance | C++ | This is a C++ program that demonstrates access control in inheritance, with a Base class that has public, protected, and private methods, and derived classes that inherit from it using private, protected, and public inheritance, respectively. The program tests the accessibility of the Base class methods from the derived classes and shows the output of the accessible methods. |
17 | Scope Resolution Operator | C++ | The program demonstrates how to use global variables, namespaces, and classes with member and static variables and functions, and it uses the scope resolution operator to specify the scope of the variables and functions. |
18 | Sequence container: Array | C++ | The program demonstrates the use of STL arrays and various array operations, such as sorting, filling, and swapping, as well as accessing array elements, using C++ STL array functions. |
19 | Sequence container: Vector | C++ | The program demonstrates the use of STL vector and various operations, such as sorting, filling, and swapping, as well as accessing array elements, using C++ STL functions. |
20 | Sequence container: List | C++ | This program demonstrates the use of the STL list container in C++, including basic operations such as inserting, deleting, and retrieving elements at the front and back of the list. |
21 | Sequence container: Forward List | C++ | This program highlights the features and benefits of the forward list container class in the C++ STL, including its efficient insertion, removal, and sorting operations, as well as its suitability for forward traversal scenarios such as hashing and graph representation. |
22 | Sequence container: Deque | C++ | This article introduces the deque container class in the C++ STL, highlighting its features as a double-ended queue that combines the functionality of both stacks and queues, and discussing its advantages and common methods. |
23 | Determine if String Halves Are Alike | C++ | The program defines a function halvesAreAlike that takes a input and checks if the first half and second half of the input have the same number of vowels. |
24 | Comparing Version Numbers | C++ | This program implements a solution to compare two version numbers represented as strings using the C++ language, by parsing the strings and comparing each component of the version number. |
25 | Insertion Sort Algorithm | C++ | This program implements the insertion sort algorithm in C++ to sort an array of integers and outputs the sorted array. |
26 | Deleting the Middle Element of a Double Linked List | C++ | This program implements a solution to delete an element at a specified position in a list container using the C++ language, and tests the function with different test cases. |
27 | Advance Function | C++ | This program demonstrates the use of iterators in C++ to traverse and manipulate elements in a container such as a list, and provides an implementation of the advance function for different iterator categories. |
28 | Trichotomous comparison | C++ | This article discusses the significance of trichotomous comparison, also known as three-way comparison, in computer science, including its applications in machine-level computation and its implementation in high-level programming languages. |
29 | Implementing a Stack | C++ | This program implements a generic stack data structure using templates in C++, and demonstrates its usage with different data types, including integers, strings, and doubles. |
20 | Implementing a Queue | C++ | This program implements a generic queue data structure using templates in C++, and demonstrates its usage with integers. |
31 | URL Shortener | C++ | This program implements a link shortener using a hash map to map original links to shortened links with randomly generated codes, and provides functionality to retrieve the original link from the shortened link. |
32 | Implementation of Vector Container | C++ | This program implements a vector class template in C++ with dynamic resizing and indexing functionality, and demonstrates its usage with integers. |
33 | Stack-based Calculator | C++ | This program implements a postfix expression calculator using a stack data structure in C++, which evaluates postfix expressions with operators +, -, *, and /, and outputs the result. |
34 | Stack Data Structure using Queue | C++ | This C++ program implements a stack data structure using two queues and performs push, pop, top, empty, and size operations. It then tests the implementation by pushing three elements, printing the top element, popping the top element, printing the new top element, and printing the size of the stack. |
34 | Stack Data Structure using Linked List | C++ | This code demonstrates the implementation of a stack data structure using linked lists in C++. It includes essential stack operations such as push, pop, top, isEmpty, and size. The code uses a singly linked list. |
To use these programs, you will need to have a C++ compiler installed on your computer. You can then download the program files from this repository and compile them using the compiler.
Alternatively, you can also use an online C++ compiler to run these programs without needing to install a compiler on your computer.
If you have any suggestions for improvements or would like to add additional C++ programs to this repository, please feel free to create a pull request. We welcome contributions from the community to make this repository more useful for everyone.