George John has Published 1167 Articles

How to convert an int to string in C++?

George John

George John

Updated on 24-Jun-2020 06:19:44

3K+ Views

You can use the itoa function from C to convert an int to string.  example#include int main() {    int a = 10;    char *intStr = itoa(a);    string str = string(intStr);    cout

Regular cast vs. static_cast vs. dynamic_cast in C++

George John

George John

Updated on 24-Jun-2020 06:13:58

10K+ Views

static_cast − This is used for the normal/ordinary type conversion. This is also the cast responsible for implicit type coersion and can also be called explicitly. You should use it in cases like converting float to int, char to int, etc.dynamic_cast −This cast is used for handling polymorphism. You only ... Read More

Rule of Three vs Rule of Five in C++?

George John

George John

Updated on 24-Jun-2020 05:51:52

395 Views

The Rule of three is a rule of thumb when using C++. This is kind of a good practice rule that says that If your class needs any ofa copy constructor, an assignment operator, or a destructor, defined explicitly, then it is likely to need all three of them.Why is ... Read More

What are the differences between -std = c++11 and -std = gnu++11?

George John

George John

Updated on 24-Jun-2020 05:45:45

1K+ Views

GNU C++ compiler, g++, provides extensions to the C++ language. The difference between the two options is whether these GNU extensions that might violate the C++ standard are enabled or not. Note that some extensions can still be in effect when using -std = c++11, if they don't violate the ... Read More

C++11 Overview

George John

George John

Updated on 24-Jun-2020 05:45:04

801 Views

C++11 is the modern C++ standard published in 2011. This brought many major extensions and improvements to the existing language. It was approved by International Organization for Standardization (ISO) on 12 August 2011 and replaced C++03.C++11 was also known as C++0x. This is because, For the next revision, it was ... Read More

How to access a local variable from a different function using C++ pointers?

George John

George John

Updated on 24-Jun-2020 05:42:36

1K+ Views

You can't access a local variable once it goes out of scope. This is what it means to be a local variable. Though, Let us look at an example where you MIGHT be able to access a local variable's memory outside its scope.Example#include int* foo() {    int x = ... Read More

CSS transition-timing-function property

George John

George John

Updated on 24-Jun-2020 05:36:48

91 Views

To set up different speed curves with transition-timing-function, you can try to run the following codeExampleLive Demo                    div {             width: 100px;             height: 100px;         ... Read More

Usage of CSS transition-delay property

George John

George John

Updated on 24-Jun-2020 05:31:57

63 Views

Use the transition-delay property to delay the transition effect with CSS. You can try to run the following code to set a 1 second delay of transitionExampleLive Demo                    div {             width: 150px;     ... Read More

CSS backface-visibility Property

George John

George John

Updated on 23-Jun-2020 16:25:40

96 Views

To determine whether an element should be visible when not facing the screen or not, use the backface-visibility propertyExampleLive Demo                    .demo1 {             position: relative;             width: 150px;   ... Read More

Python program to display Astrological sign or Zodiac sign for a given data of birth.

George John

George John

Updated on 23-Jun-2020 16:02:25

3K+ Views

Given date of birth, our task is to display astrological sign or Zodiac sign.ExamplesInput : Day = 13, Month = November Output : Scorpio.AlgorithmStep 1 : input date of birth. Step 2 : checks month and date within the valid range of a specified zodiac. Step 3 : display zodiac ... Read More

Advertisements