Bubble SortMethod is one of the sorting methods which is the simple sorting algorithm that runs by repeatedly swapping the adjacent elements if they are in the wrong order.Bubble sortsometimes referred to assinking sort.
You can use thisbubble_sort()function to sort an integer array in its range as given below.
void bubble_sort(int A[], int n)
{
for ( int…
Tutorial: Learn To Copy Matrix As A Excel Clipboard In Modern C++
February 17, 2021
Clipboardalso called thepaste buffer, is a buffer that operating systems provide to copy things (texts, bitmaps, tables, etc.) for the short term and transfer within and between application programs. The clipboard is usually temporary and unnamed, and its…
Tutorial: Learn To Sort A Text File On Windows With C++
February 15, 2021
In C++ Builder sorting text string lines is very easy by setting Sorted property of a StringList to true. This example below sorts a given text file and saves as sorted in same name.
void sort_textfile(UnicodeString filename)
{
auto str_list = new TStringList;
…
ASCII Art: Fun Code Spinning Donut In 3D Text Form In C++
February 13, 2021
There is no word to say, we would like to share this Amazing 3D Spinning Donut by Andy Sloane . This full post explains what is mathematic behind this. Please visit his awesome post here. There is also another video of his codes by Professor Lex Fridman here. We just made few changes on codes for the C++ Builder Console VCL Application, it runs well as in original.
void rotate_donut_3D(void)
{…
Tutorial: Easily Learn To Draw Mandelbrot In C++ On Windows
February 9, 2021
Inmathematics, Fractalsare a self-similar subset ofEuclidean space whose fractal dimensions strictly exceeds its topological dimension. So when you draw these functions in their topological height, fractals appear the same at different levels, as…
Tutorial: Learn To Print Mandelbrot In Text Form In C++
February 7, 2021
Inmathematics, fractalsare a self-similar subset ofEuclidean space whose fractal dimensions strictly exceeds its topological dimension. So when you draw these functions in their topological height, fractals appear the same at different levels, as…
C++ Builder is easy to operate on files on Windows. There are many methods to operate on files. Some of these methods are explained well in Windows File Operations in Modern C++. In this post we create a snippet to search and count a text from a text file.
unsigned int count_text(UnicodeString text, UnicodeString filename)
{
if(FileExists(filename))
{
UnicodeString us;
unsigned int…
Learn To Use Powerful Lambda Expressions In C++ On Windows
February 5, 2021
Lambda Expressionsare an expression that returns a function object, it comes with C++11 standards and used C++14, C++17, C++20 standards, it is well explainedhere. Lambda expressions are widely used in C++, C#, Groovy, Java, Python, Ruby languages too.
The…
Learn To Use Powerful Cryptographic Hash Functions In Modern C++ On Windows (SHA, SHA2, MD5, BobJenkins)
February 4, 2021
Cryptographic Hash Functionsare a one-way algorithm that takes an input of any size and produces the same size output. The cryptographic hash functions are a more secure version of the hash functions. It is one-way in that there is information loss — you can’t…
Fibonacci Numbers are sequence numbers called the Fibonacci sequence, and in mathematics, it starts with 0 and 1, and then each number is the sum of the two preceding ones. Fibonacci numbers are strongly related to Golden Ratio. In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of two quantities. There is Binet’s…