How to declaring pointer variables in C/C++?

Anvi Jain
Updated on 30-Jul-2019 22:30:26

397 Views

A pointer is used to store the address of the variables. To declare pointer variables in C/C++, an asterisk (*) used before its name.Declaration*pointer_nameIn CExample Live Demo#include int main() {    // A normal integer variable    int a = 7;    // A pointer variable that holds address of a.    int *p = &a;    // Value stored is value of variable "a"    printf("Value of Variable : %d", *p);    //it will print the address of the variable "a"    printf("Address of Variable : %p", p);    // reassign the value.    *p = 6;    printf("Value ... Read More

What is lambda binding in Python?

Sri
Sri
Updated on 30-Jul-2019 22:30:26

485 Views

When a program or function statement is executed, the current values of formal parameters are saved (on the stack) and within the scope of the statement, they are bound to the values of the actual arguments made in the call. When the statement is exited, the original values of those formal arguments are restored. This protocol is fully recursive. If within the body of a statement, something is done that causes the formal parameters to be bound again, to new values, the lambda-binding scheme guarantees that this will all happen in an orderly manner.there is only one binding for x: ... Read More

Python zip() Function

Hafeezul Kareem
Updated on 30-Jul-2019 22:30:26

314 Views

zip() function is used to group multiple iterators. Look at the doc of the zip() function using help method. Run the following code to get the help on zip() function.Example Live Demohelp(zip)If you run the above program, you will get the following results.OutputHelp on class zip in module builtins: class zip(object)    | zip(iter1 [, iter2 [...]]) --> zip object    |    | Return a zip object whose .__next__() method returns a tuple where    | the i-th element comes from the i-th iterable argument. The .__next__()    | method continues until the shortest iterable in the argument sequence   ... Read More

HTML DOM Input Month stepUp() Method

Sharon Christine
Updated on 30-Jul-2019 22:30:26

38 Views

The HTML DOM input month stepUp() method steps up (increment) the value of input month field by a specified value.SyntaxFollowing is the syntax −object.stepUp(number)Here, if number parameter is omitted then it increments the value by 1.ExampleLet us see an example of input month stepUp() method − Live Demo HTML DOM stepUp()/stepDown() Demo body{ text-align:center; background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat; height:100vh; color:#fff; ... Read More

HTML DOM Link sizes Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

102 Views

The HTML DOM Link sizes property returns the value of the sizes attribute of link element.NOTE − The sizes property is used only when rel property is set to ‘icon’SyntaxFollowing is the syntax −Returning sizes attribute valuelinkObject.sizesExampleLet us see an example for Link rel property − Live Demo Link sizes Link-sizes    var divDisplay = document.getElementById("divDisplay");    var extStyle = document.getElementById("extStyle");    if(extStyle.sizes == '10x10')       divDisplay.textContent = 'The linked icon size: '+extStyle.sizes+' is not compatible';    else       divDisplay.textContent = 'Congrats! The linked icon size is ... Read More

Lexicographically next permutation in C++

Smita Kapse
Updated on 30-Jul-2019 22:30:26

2K+ Views

Here we will see how to generate lexicographically next permutation of a string in C++. The lexicographically next permutation is basically the greater permutation. For example, the next of “ACB” will be “BAC”. In some cases, the lexicographically next permutation is not present, like “BBB” or “DCBA” etc.In C++ we can do it by using a library function called next_permutation(). This is present in the algorithm header file.Example#include #include using namespace std; main() {    string s = "DBAC";    for(int i = 0; i

C++ Program to Find the Longest Subsequence Common to All Sequences in a Set of Sequences

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

99 Views

Here we shall discuss a C++ program to find the Longest Subsequence Common to All Sequences in a Set of Sequences.AlgorithmsBegin Take the array of strings as input. function matchedPrefixtill(): find the matched prefix between string s1 and s2 :    n1 = store length of string s1.    n2 = store length of string s2.    for i = 0, j = 0 to i

Token Bus (IEEE 802.4) Network

Moumita
Updated on 30-Jul-2019 22:30:26

5K+ Views

Token Bus (IEEE 802.4) is a standard for implementing token ring over the virtual ring in LANs. The physical media has a bus or a tree topology and uses coaxial cables. A virtual ring is created with the nodes/stations and the token is passed from one node to the next in a sequence along this virtual ring. Each node knows the address of its preceding station and its succeeding station. A station can only transmit data when it has the token. The working principle of the token bus is similar to Token Ring.Token Passing Mechanism in Token BusA token is ... Read More

Write the syntax of javascript with a code to demonstrate it?

vineeth.mariserla
Updated on 30-Jul-2019 22:30:26

115 Views

JavaScript TagsThe html script tag wants the browser to get a script between them. We can expect the scripts to be in the following places. 1.The script can be placed in html's head tag 2.Within Html's body tag. 3.As an external file. Most importantly client side scripts such as JavaScript are placed in script tags.demonstration code  Live Demo This example writes "JavaScript is not java" into an HTML element with id="script"    document.getElementById("imp").innerHTML = "JavaScript is not java"; OutputThis example writes "JavaScript is not java" into an HTML element with id="script" JavaScript is not javaExplanationEvery JavaScript code should be in ... Read More

How to arrange components in a FlowLayout to be left-justified in Java?

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

194 Views

Use FlowLayout.LEFT to arrange components in a FlowLayout to be left-justified. The following is an example to arrange components in a FlowLayout to be left-justified −Examplepackage my; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextArea; import javax.swing.WindowConstants; public class SwingDemo {    public static void main(String[] args) {       JFrame frame = new JFrame("Internet Language");       frame.setLayout(new FlowLayout(FlowLayout.LEFT));       JLabel label = new JLabel("Top Internet Language");       label.setPreferredSize(new Dimension(240, 70));       label.setOpaque(true);       label.setBackground(Color.RED);       label.setForeground(Color.WHITE);       Font ... Read More

Advertisements