Nishtha Thakur has Published 564 Articles

fdim() in C++

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

96 Views

Here we will see what is the fdim() function in C++. The fdim() function is used to return the positive difference between two given arguments. If two arguments are a and b respectively, and if a >b, then it will return a – b. otherwise returns 0.Example#include #include ... Read More

How to convert a std::string to const char* or char* in C++?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

1K+ Views

In this section, we will see how to convert C++ string (std::string) to const char* or char*. These formats are C style strings. We have a function called c_str(). This will help us to do the task. It returns a pointer to an array that contains a null-terminated sequence of ... Read More

Is there any need of “long” data type in C and C++?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

95 Views

In C or C++, there are four different datatypes, that are used for integer type data. These four datatypes are short, int, long and long long. Each of these datatypes takes different memory spaces. The size varies in different architecture and different operating systems. Sometimes int takes 4-bytes or sometimes ... Read More

How to map C++ enums to strings?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

3K+ Views

Here we will see how to map some enum type data to a string in C++. There is no such direct function to do so. But we can create our own function to convert enum to string.We shall create a function that takes an enum value as the argument, and ... Read More

MySQL query to remove Null Records in a column?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

2K+ Views

To remove NULL records in a column, you can use delete command. Following is the syntax −delete from yourTableName where yourColumnName IS NULL;Let us first create a table −mysql> create table removeNullRecordsDemo    -> (    -> Name varchar(100)    -> ); Query OK, 0 rows affected (0.50 sec)Following is ... Read More

C++ Program to Create a Random Graph Using Random Edge Generation

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

865 Views

In this program a random graph is generated for random vertices and edges. The time complexity of this program is O(v * e). Where v is the number of vertices and e is the number of edges.AlgorithmBegin    Develop a function GenRandomGraphs(), with ‘e’ as the    number of edges ... Read More

How to aggregate sum in MongoDB to get the total count?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

812 Views

To aggregate sum in MongoDB to get the total count, you can use the $sum operator. To understand the above concept, let us create a collection with the document −> db.aggregateSumDemo.insertOne({"CustomerName":"Larry", "Amount":140}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8baa0680f10143d8431e18") } > db.aggregateSumDemo.insertOne({"CustomerName":"Mike", "Amount":160}); {    "acknowledged" : true, ... Read More

How to remove data from hashset in Android?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

133 Views

This example demonstrates about How to remove data from HashSet in AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         ... Read More

string at() function in C++

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

83 Views

In this section, we will see what is the at a () function in C++. The at() function is used to access the character at a given position.In this program, we will iterate through each character using at a () function and print them into different lines.Example Code Live Demo#include using ... Read More

How to strip all spaces from a column in MySQL?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jul-2019 22:30:25

1K+ Views

To strip all spaces from a column in MySQL, you can use REPLACE() function. Following is the syntax −update yourTableName set yourColumnName=REPLACE(yourColumnName, ' ', '' );Let us first create a table −mysql> create table stripAllSpacesDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Name ... Read More

Advertisements