Server Side Programming Articles - Page 1825 of 2650

map key_comp() function in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:13:50

253 Views

In this article we will be discussing the working, syntax and examples of map::key_comp() function in C++ STL.What is Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is map::key_comp()?The map::key_comp( ) is a function which comes under header file. This function returns a copy of a key comparison object. This ... Read More

map get_allocator in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:10:24

279 Views

In this article we will be discussing the working, syntax and examples of map::get_allocator() function in C++ STL.What is Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination on key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in map container is accessed by its unique keys.What is map::get_allocator()?The map::get_allocator( ) is a function which comes under header file. get_alloctaor() is used to get the allocator object which is associated with ... Read More

map find() function in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:07:34

2K+ Views

In this article we will be discussing the working, syntax and examples of map::find() function in C++ STL.What is Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination on key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in map container is accessed by its unique keys.What is map::find()?The map::find( ) is a function which comes under header file. This function returns an iterator which points to an element of a ... Read More

map erase() function in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 12:04:40

884 Views

In this article we will be discussing the working, syntax and examples of map::erase() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination on key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in map container is accessed by its unique keys.What is map::erase()?The map::erase( ) is a function which comes under

map emplace() in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 11:57:07

784 Views

In this article we will be discussing the working, syntax and examples of map::emplace() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is a map::emplace()?The map::emplace( ) is a function which comes under header file. This function constructs and inserts an element into the ... Read More

map emplace_hint() function in C++ STL

Sunidhi Bansal
Updated on 15-Apr-2020 11:54:52

188 Views

In this article we will be discussing the working, syntax and examples of map::emplace_hint() function in C++ STL.What is a Map in C++ STL?Maps are the associative container, which facilitates to store the elements formed by a combination of key value and mapped value in a specific order. In a map container the data is internally always sorted with the help of its associated keys. The values in the map container are accessed by its unique keys.What is map::emplace_hint()?The map::emplace_hint( ) is a function which comes under  header file. This function constructs and inserts an element with a hint into ... Read More

Explain difference between == and is operator in Python.

Mahesh Parahar
Updated on 15-Apr-2020 08:24:35

324 Views

== operator== operator compares the operands by checking the equality of values of objects.is operatoris operator compares the operands by checking the objects to be the same or not.ExampleFollowing is the program in Python to showcase the difference. Live Demolist1 = [1] list2 = [1] list3 = list1 print(id(list1)) print(id(list2)) if (list1 == list2):    print("True") else:    print("False") if (list1 is list2):    print("True") else:    print("False") if (list1 is list3):    print("True") else:    print("False")Output140380664377096 140380664376904 True False True

Difference between two given time periods in C++

Mahesh Parahar
Updated on 15-Apr-2020 08:18:24

463 Views

Problem StatementGiven two time periods in the string 'HH:MM: SS' format. Here 'HH' represents hours, 'MM' represents minutes and 'SS' represents seconds. Find the difference in the same string format between these two time periods.Time period 1 = 8:6:2 Time period 2 = 3:9:3 Time Difference is 4:56:59ExampleFollowing is the program in C++ to find the required output. Live Demo#include using namespace std; int main() {    int hour1, minute1, second1;    int hour2, minute2, second2;    int diff_hour, diff_minute, diff_second;    cout minute1 >> second1;    cout minute2 >> second2;    if(second2 > second1) {     ... Read More

Difference between out and ref keyword in C#

Mahesh Parahar
Updated on 16-May-2020 14:16:00

19K+ Views

out keywordout keyword is used to pass arguments to method as a reference type and is primary used when a method has to return multiple values. ref keyword is also used to pass arguments to method as reference type and is used when existing variable is to be modified in a method. Following is the valid usage of ref and out keywords in C#.Example Live Demousing System.IO; using System; public class Program {    public static void update(out int a){       a = 10;    }    public static void change(ref int d){       d = 11; ... Read More

Difference between readonly and const keyword in C#

Mahesh Parahar
Updated on 16-May-2020 14:14:55

12K+ Views

readonly keywordreadonly keyword is used to define a variable which can be assigned once after declaration either during declaration or in constructor. const keyword is used to define a constant to be used in the program. Following is the valid usage of a readonly and const keywords in C#.Example Live Demousing System.IO; using System; public class Program {    public const int VALUE = 10;    public readonly int value1;    Program(int value){       value1 = value;    }    public static void Main() {       Console.WriteLine(VALUE);       Program p1 = new Program(11); ... Read More

Advertisements