Rishi Rathor has Published 149 Articles

Execute a script when an element is being dragged over a valid drop target in HTML?

Rishi Rathor

Rishi Rathor

Updated on 03-Mar-2020 09:41:42

91 Views

When an element is being dragged and dropped in HTML, the ondragover attribute fires.ExampleYou can try to run the following code to implement the ondragover attribute −                    .drag {             float: left;     ... Read More

How to execute the script when the page has finished parsing in HTML?

Rishi Rathor

Rishi Rathor

Updated on 03-Mar-2020 05:29:14

344 Views

Use the defer attribute to execute the script when the page has finished parsing in HTML.Firstly, add a js file.Let us give it a name,  new.js, function sayHello() {    alert("Hello World") }ExampleLet’s add the HTML code now and execute the above script −             ... Read More

How to store a name permanently using HTML5 Local Storage?

Rishi Rathor

Rishi Rathor

Updated on 25-Feb-2020 07:00:54

293 Views

The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.HTML5 localStorage saves string data in ... Read More

protected access modifier in Java

Rishi Rathor

Rishi Rathor

Updated on 24-Feb-2020 12:32:07

607 Views

Variables, methods, and constructors, which are declared protected in a superclass can be accessed only by the subclasses in other package or any class within the package of the protected members' class.The protected access modifier cannot be applied to class and interfaces. Methods, fields can be declared protected, however methods ... Read More

Why it shows 0 instead of empty string whenever I insert an empty string into a MySQL column which is declared as NOT NULL?

Rishi Rathor

Rishi Rathor

Updated on 14-Feb-2020 06:22:42

981 Views

It is because inserting an empty string means that we are inserting some value and not NULL. The empty string apparently maps to zero as an integer. In other words, we can say that by inserting empty string we are providing a value to MySQL that has integer representation as ... Read More

Can a local variable's memory be accessed outside its scope in C/C++?

Rishi Rathor

Rishi Rathor

Updated on 11-Feb-2020 10:20:27

125 Views

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 = 3;    return &x; } int main() {    int* address = foo();    cout

What is Bitwise AND in C++?

Rishi Rathor

Rishi Rathor

Updated on 11-Feb-2020 07:30:01

127 Views

The bitwise AND operator (&) compares each bit of first operand to the corresponding bit of second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0. Both operands to the bitwise inclusive AND operator must be ... Read More

Difference between Relational operator(==) and std::string::compare() in C++

Rishi Rathor

Rishi Rathor

Updated on 11-Feb-2020 05:52:44

243 Views

There is only one difference between the relational operator == and std::string::compare(). That is the return value. Internally, string::operator==() is using string::compare()Relational operator(==) returns a boolean just signifying whether the 2 strings are equal or not while compare returns an integer that signifies how the strings relate to each other.To ... Read More

What is pointer operator & in C++?

Rishi Rathor

Rishi Rathor

Updated on 10-Feb-2020 13:30:36

2K+ Views

C++ provides two pointer operators, which are Address of Operator (&) and Indirection Operator (*). A pointer is a variable that contains the address of another variable or you can say that a variable that contains the address of another variable is said to "point to" the other variable. A ... Read More

What are signed and unsigned keywords in C++?

Rishi Rathor

Rishi Rathor

Updated on 10-Feb-2020 12:26:50

2K+ Views

All number types in C++ can either have a sign or not. For example, you can declare an int to only represent positive integers. Unless otherwise specified, all integer data types are signed data types, i.e. they have values which can be positive or negative. The unsigned keyword can be ... Read More

Previous 1 ... 6 7 8 9 10 ... 15 Next
Advertisements