Ramu Prasad has Published 74 Articles

Tokenize a string in C++?

Ramu Prasad

Ramu Prasad

Updated on 11-Feb-2020 11:03:12

183 Views

First way is using a stringstream to read words seperated by spaces. This is a little limited but does the task fairly well if you provide the proper checks. example#include #include #include using namespace std; int main() {    string str("Hello from the dark side");   ... Read More

Why can C++ templates only be implemented in the header file?

Ramu Prasad

Ramu Prasad

Updated on 11-Feb-2020 10:14:53

730 Views

When you instantiate a template in C++, the compiler creates a new class. This class has all the places where you placed the template arguments replaced with the actual argument you pass to it when using it. For example −template class MyClass {    T foo;    T myMethod(T arg1, ... Read More

Simple Arithmetic Operators Example Program In C++

Ramu Prasad

Ramu Prasad

Updated on 11-Feb-2020 05:07:26

12K+ Views

C++ has 5 basic arithmetic operators. They are −Addition(+)Subtraction(-)Division(/)Multiplication(*)Modulo(%)These operators can operate on any arithmetic operations in C++. Let's have a look at an example −Example#include using namespace std; main() {    int a = 21;    int b = 10;    int c ;    c = a + b;    cout

Assignment Operators in C++

Ramu Prasad

Ramu Prasad

Updated on 10-Feb-2020 13:13:50

256 Views

Assignment operators store a value in the object designated by the left operand. There are two kinds of assignment operations: simple assignment, in which the value of the second operand is stored in the object specified by the first operand, and compound assignment, in which an arithmetic, shift, or bitwise ... Read More

What are type specifiers in C++?

Ramu Prasad

Ramu Prasad

Updated on 10-Feb-2020 12:22:21

2K+ Views

When you first declare a variable in a statically typed language such as C++ you must declare what that variable is going to hold.int number = 42;In that example, the "int" is a type specifier stating that the variable "number" can only hold integer numbers. In dynamically typed languages such ... Read More

How can we analyze the tables of a particular database from MySQL Server command line?

Ramu Prasad

Ramu Prasad

Updated on 10-Feb-2020 06:48:01

160 Views

We need to use ‘mysqlcheck’ client program along with –analyze option to analyze the tables of a particular database. Its syntax would be as follows −Mysqlcheck – u root –analyze db_nameExampleThe following command will analyze the tables of database ‘query’ −C:\mysql\bin>mysqlcheck -u root --analyze query query.cars           ... Read More

How MySQL evaluates the blank line between two lines written in the text file while importing that text file into MySQL table?

Ramu Prasad

Ramu Prasad

Updated on 06-Feb-2020 06:07:46

150 Views

Suppose if there is a blank line between two line written in the text file then MySQL evaluates it as the data line while importing that text file into MySQL table. It can be understood with the help of the following example −ExampleSuppose we are having a blank line between ... Read More

How to use classes in other package in Java

Ramu Prasad

Ramu Prasad

Updated on 04-Feb-2020 11:21:21

478 Views

You can understand it using an example where a Boss class is defined in payroll package.package payroll; public class Boss {    public void payEmployee(Employee e) {       e.mailCheck();    } }if the Employee class is not in the payroll package? The Boss class must then use one ... Read More

Usage of color property in CSS

Ramu Prasad

Ramu Prasad

Updated on 31-Jan-2020 06:25:32

83 Views

The color property is used to set the color of text. You can try to run the following code to learn how to work with the color property in CSS:Example                            This text will be written in blue.          

Set the Background Attachment with CSS

Ramu Prasad

Ramu Prasad

Updated on 30-Jan-2020 09:21:35

104 Views

To set the background-attachment, use the background-attachment property. Background attachment determines whether a background image is fixed or scrolls with the rest of the page.ExampleYou can try to run the following code to learn how to work with the background-attachment property to set fixed background image:       ... Read More

Advertisements