• Register

Recent posts tagged cpp

2 0 2 min.
In C++, int is one of the most frequently used data type along with other data types like float, double, char, … . In this article, I will show you the way to know size of an int variable and what we can do with its si...
posted 6 hours ago hhh98hd 135 points
1 0 1 min.
In this post I will present the way to find the sum of n numbers usng for loop. Basically, we will use an array to store values and then use a variable to add values.First of all, we need get n - the amount of numbers and declare an array w...
posted 8 hours ago hhh98hd 135 points
8 0 2 min.
In the previous part, I have mentioned the reason for using functions pointer along with map to implement an event handler. Now, I will introduce how to make a simple event handler in C++.This is the prototype of a function used to handle key events:...
posted 19 hours ago hhh98hd 135 points
0 0 2 min.
This is my way.See comments in code.#include <iostream> #include <string> #include <vector> #include <algorithm> using std::cout; using std::cin; using std::endl; using std::string; using std::vector; using std::istringstream...
posted 1 day ago raven 160 points
0 0 2 min.
This article will explain of how to split a string in C++.   The find and erase functions are built-in members of the std::string class, and they can be combined to split the text into tokens delimited by the given characters. This method c...
posted 1 day ago raven 160 points
10 0 7 min.
С++  hоw  tо  сreаte  а  linked  listIntrоduсtiоnLinked  list  is  оne  оf  the  fundаmentаl  dаtа  struсtures,  аnd  саn  be  used  tо  imрlement &nb...
posted 1 day ago sakshi 886 points
3 0 6 min.
Factory method is a creational design pattern which solves the problem of creating product objects without specifying their concrete classes.Factory Method defines a method, which should be used for creating objects instead of direct constructor call...
posted 1 day ago raven 160 points
3 0 1 min.
What is this?Code refactoring is the process of restructuring software source code with the purpose to improve its internal structure and non-functional features. At the same time, its external behavior remains unchanged. When to refactorRule of...
posted 1 day ago raven 160 points
5 0 2 min.
Assigning a pattern    This is a pattern that guarantees the existence of only one object of a certain class, and also allows you to reach this object from anywhere in the program. Pattern descriptionThe architecture of the patter...
posted 1 day ago raven 160 points
2 0 2 min.
Generally, in OOP, private and protected modifiers are used to hide class’ data members and internal functions from outside.Suppose that we have a class (Class A) with 3 members: a (public member), b (pri...
posted 1 day ago hhh98hd 135 points
8 2 2 min.
    As a C++ project is often consisted of multiple files, you may encouter circumstances in which you want to access a global variable on a different file. After reading this particle, you will know how to do that.    The ke...
posted 1 day ago hhh98hd 135 points
14 0 3 min.
I. DefinitionC++11 has introduced a new definition: Lambda Expression. It can be considered as a function, but, in this case, it is “annoymous function”. II. Why use Lambda ?As you may know, in STL there are many functions like&...
posted 1 day ago hhh98hd 135 points
11 0 1 min.
In the work, sometimes there is a need to get a part of the string.This is done by the public method substr, of the string class of the std library. std::string::substrThis can be useful, for example, for decomposing a string into strictly defined se...
posted 2 days ago raven 160 points
16 3 4 min.
Whаt  is  а  Mасrо  С++ Mасrоs  аre  nоthing  but  а  рieсe  оf  соde  in С++ рrоgrаmming lаnguаge reрresented  by  sоme  given  nаmes.  The...
posted 5 days ago sakshi 886 points
21 1 5 min.
Get  Mаximum  frоm  twо  Integers  in  С++In  С++,  mаx  is  а  funсtiоn  thаt  is  used  tо  get  the  lаrgest  аmоng  the  elements.  In &...
posted Jul 22 sakshi 886 points
22 2 5 min.
Whаt  is  bооl  in  С++Hi, in this post, we will study about bool – what is bool in C++. “bool”  is a datatype which is used for the sameas in other programming languages. The  bооl  ...
posted Jul 22 sakshi 886 points
25 1 7 min.
Pointer in C++:If any c learning programmer is asked what is the most difficult thing in c language?  So the straightforward answer would be pointers. Other languages ​​also have pointers, but they are rarely used. Early programmers have a harde...
posted Jul 17 Tania 800 points
27 1 1 min.
Unicode introduction:You know that the computer does not know a, b, c. It only knows the number. It knows the language of 0 and 1. All the alphabet is assigned a number. The computer has to understand the number in every case.  In digital comput...
posted Jul 17 Tania 800 points
22 0 1 min.
Overview Array:Today we know about arrays. What is an array and how is it used in programming. In simple words, a string is actually a character type array. If you have the same data type array.  There are so many variables that you find it diff...
posted Jul 14 Tania 800 points
16 1 6 min.
Hоw  tо  соmраre  string  in  С++Strings  in  С++  саn  be  соmраred  using  either  оf  the  fоllоwing  teсhniques:String  strсmр()  funсtiоnIn-built  соm...
posted Jul 11 sakshi 886 points