Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 1825 of 2650
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
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
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
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
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
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
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
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
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
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