Abhinanda Shri has Published 74 Articles

How to execute a command and get the output of command within C++ using POSIX?

Abhinanda Shri

Abhinanda Shri

Updated on 12-Feb-2020 06:15:52

10K+ Views

You can use the popen and pclose functions to pipe to and from processes. The popen() function opens a process by creating a pipe, forking, and invoking the shell. We can use a buffer to read the contents of stdout and keep appending it to a result string and return ... Read More

Increment ++ and Decrement -- Operator Overloading in C++

Abhinanda Shri

Abhinanda Shri

Updated on 11-Feb-2020 07:06:42

286 Views

The increment (++) and decrement (--) operators area unit 2 necessary unary operators available in C++. Following example explain how increment (++) operator can be overloaded for prefix as well as postfix usage. Similar way, you can overload operator (--).Example#include using namespace std; class Time {    private: ... Read More

Conditional ternary operator ( ?: ) in C++

Abhinanda Shri

Abhinanda Shri

Updated on 11-Feb-2020 05:30:35

462 Views

The conditional operator (? :) is a ternary operator (it takes three operands). The conditional operator works as follows −The first operand is implicitly converted to bool. It is evaluated and all side effects are completed before continuing.If the first operand evaluates to true (1), the second operand is evaluated.If ... Read More

What is dot operator in C++?

Abhinanda Shri

Abhinanda Shri

Updated on 10-Feb-2020 12:53:15

980 Views

The dot and arrow operator are both used in C++ to access the members of a class. They are just used in different scenarios. In C++, types declared as a class, struct, or union are considered "of class type". So the following refers to both of them.a.b is only used ... Read More

HAS-A relationship in Java

Abhinanda Shri

Abhinanda Shri

Updated on 04-Feb-2020 12:06:28

1K+ Views

These relationships are mainly based on the usage. This determines whether a certain class HAS-A certain thing. This relationship helps to reduce duplication of code as well as bugs.Let's look into an example −Examplepublic class Vehicle{} public class Speed{} public class Van extends Vehicle {    private Speed sp; }This ... Read More

Align the text of a paragraph with CSS

Abhinanda Shri

Abhinanda Shri

Updated on 31-Jan-2020 06:04:53

406 Views

To align the text of a paragraph, use the text-indent property.ExamplePossible values are % or a number specifying indent space. You can try to run the following code to implement a text-index property with CSS:                            This text ... Read More

Increase or decrease how bold or light a font appears with CSS

Abhinanda Shri

Abhinanda Shri

Updated on 30-Jan-2020 10:19:08

220 Views

The font-weight property provides the functionality to specify how bold a font is. Possible values could be normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900.                   This font is bold.       This font is bolder.       This font is 500 weight.    

In MySQL, how can we represent the time value as an integer?

Abhinanda Shri

Abhinanda Shri

Updated on 30-Jan-2020 05:27:51

516 Views

In MySQL, UNIX timestamp format is the way to represent time value as an integer. The integer value represented for the date value would be the number of seconds. The starting date for counting these number of seconds is ‘1970-01-01’.mysql> SELECT UNIX_TIMESTAMP('2017-10-22 04:05:36')AS 'Total Number of Seconds'; +-------------------------+ | Total ... Read More

In JavaScript inheritance how to differentiate Object.create vs new?

Abhinanda Shri

Abhinanda Shri

Updated on 24-Jan-2020 10:16:54

93 Views

In the first example, you are just inheriting amitBaseClass prototype.function SomeClass() { } SomeClass.prototype = Object.create(amitBaseClass.prototype);In the second example, you are executing the constructor function. An instance of amitBaseClass is created and you are inheriting the who complete amitBaseClass object.function SomeClass () { } SomeClass.prototype = new amitBaseClass ();So, ... Read More

What is the difference between "strict" and "non-strict" modes of JavaScript?

Abhinanda Shri

Abhinanda Shri

Updated on 16-Jan-2020 10:27:46

830 Views

The “use strict” is a directive, which is a literal expression. It introduced in JavaScript 1.8.5. As the name suggests, “use strict” indicates that the code is to be executed in strict mode. Under non-strict, the code won’t execute won’t execute in strict mode.Let us declare strict mode. To declare, ... Read More

Advertisements