
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7197 Articles for C++

811 Views
In this tutorial, we will be discussing a program to generate CAPTCHA and verify user.For this, we will provide the user with a random string and ask him to reenter the same string. Then it has to be checked if the given and the input string matches.The CAPTCHA should be completely random system generated consisting of a-z, AZ and 0-9.Example#include using namespace std; //checks if the strings are same bool check_string(string &captcha, string &user_captcha){ return captcha.compare(user_captcha) == 0; } //generates a random string as Captcha string gen_captcha(int n){ time_t t; srand((unsigned)time(&t)); char *chrs = "abcdefghijklmnopqrstuvwxyzABCDEFGHI" "JKLMNOPQRSTUVWXYZ0123456789"; ... Read More

4K+ Views
The following C++ program illustrates how to remove the vowels (a, e, i, u, o) from a given string. In this context, we create a new string and process input string character by character, and if a vowel is found it is excluded in the new string, otherwise the character is added to the new string after the string ends we copy the new string into the original string. The algorithm is as follows;AlgorithmSTART Step-1: Input the string Step-3: Check vowel presence, if found return TRUE Step-4: Copy it to another array Step-5: Increment the counter ... Read More

3K+ Views
This article is serving the purpose of validating the correct IP (internet protocol) address by virtue of C++ code programming. The IP address is a 32-bit dot-decimal-notation, broken into four decimal numbers segments ranging from 0 to 255. Furthermore, these numbers are separated by dots consecutively. The IP address serves the purpose of identifying a host machine in the network in a unique manner in order to establish a connection among them.So, in order to validate the correct IP address input from the user-end, the following algorithm briefs how exactly the code sequence is materialized to identify the correct IP ... Read More

694 Views
This aim of this program to replace a particular word with asterisks in the string by using the c++ programming code. The essential function of vector and string class essay a key role to achieve the prospective results. The algorithm is as follows;AlgorithmSTART Step-1: Input string Step-2 Split the string into words and store in array list Step-3: Iterate the loop till the length and put the asterisk into a variable Step-4: Traverse the array foreah loop and compare the string with the replaced word Step-5: Print ENDNow, the following code is carved out based ... Read More

206 Views
Linked list allocates memory dynamically, is used to implement a stack. This program showcase the reversal of the link list in c++ programming. Here, the aspirant can adopt the following approach to get the expected results. The algorithm is as follows;AlgorithmSTART Step 1: create an empty stack of type node pointer Step 2: Traverse the list and push all of its nodes onto a stack Step 4: Traverse the list from the head node again Step 5: pop a value from the stack top step 6: connect them in reverse order Step 7: PRINT ... Read More

2K+ Views
In this C++ program, the space in the string will be replaced with the hyphen. Firstly, the length of the string is determined by the length() function of the cstring class, then hyphen is filled into the space of the sentence by traversing the string as follows.Example Live Demo#include #include using namespace std; int main(){ // raw string declaration string str = "Coding in C++ programming"; cout

279 Views
Math ClassThis article demonstrates the usage of math class essentials functions sqrt(), sqrtl(), and sqrtf() to calculate the square root of double, long, and float type variables with precision respectively. The Math class of C++ offers a wide range of functions to calculate mathematical calculations including sin, cos, square root, ceil, floor, etc..It is, therefore, mandatory to import the definition of header class library in the program in order to avail all calculative methods.Sqrt MethodThe double sqrtl () method of the Math class returns the square root of a double variable with precision. The syntax of this function is ... Read More

576 Views
AbstractThis short tutorial is an overview of the C++ String class at() functionality in order to access a sequence of characters from the string. In the forthcoming section, an aspiring reader can through string class programming examples to get a thorough understanding of the manipulation of at() functions.String ClassIn programming terms, the strings are typical, a double-quotes representation, contain a collection of characters. The string class is a container class too, to iterate over all its characters using an iterator operator []. Besides, The String class handles all operations related to memory and null termination. Anyone can perform plenty of ... Read More

310 Views
This tutorial is designed to swap the upper row of a three-diagonal array to its lower one using c++ code. Moreover, if a three-diagonal array is an input, the coveted results must be something like that as;For this, the course of action is briefed in the algorithm as follows;AlgorithmStep-1: Input a diagonal array Step-2: Pass it to Swap() method Step-3: Traverse the outer loop till 3 Step-4: increment j= i+ 1 in the inner loop till 3 Step-5: put the array value in a temp variable Step-6: interchange the value arr[i][j]= arr[j][i] Step-7: put the temp data to arr[j][i] Step-8: ... Read More

931 Views
This program translates the characters of a string into uppercase. However, this task can be easily achieved by using the toUpper() method of the c++ class library. But in this program, we perform this by calculating the ASCII value of characters in uppercase. The Algorithm is as follows;AlgorithmSTART Step-1: Declare the array of char Step-2: Check ASCII value of uppercase characters which must grater than A and lesser than Z Step-3: Check ASCII value of lower characters which must grater than A and lesser than Z ENDThe toggleChar() method gets the array of characters as an input. ... Read More