
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
Found 33676 Articles for Programming

2K+ Views
Set is an abstract data type in which each element has to be unique because the value of the element identifies it. The value of the element cannot be modified once it is added to the set, but it is possible to remove and add the modified value of that element.A Map is an associative container that store elements in a mapped fashion. Each element has a key value and a mapped value. No two mapped values can have the same key values.So, it is clear from above that, set contains the only key, and map contains a value with ... Read More

601 Views
Set find() function in C++ STL returns an iterator to the element which is searched in the set container. The iterator points to the position just after the last element in the set, if the element is not found.AlgorithmBegin Define function printS() to print elements of set container. initialize an empty set container s. Insert some elements in s set container. Call function to print elements of set container. Call the set find() function to find an element from s set container. If element is in the set then Print elememt is ... Read More

1K+ Views
The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously. The copy constructor is used to Initialize one object from another of the same type. Copy an object to pass it as an argument to a function. Copy an object to return it from a function. If a copy constructor is not defined in a class, the compiler itself defines one. If the class has pointer variables and has some dynamic ... Read More

376 Views
The functors are the function objects in C++. The functor allows an instance object of some class to be called as if it were an ordinary function. Let us consider a function that takes one argument. We can use this function as function object to do some task on a set of data. The Functors are widely used in STL algorithms like transform(), sort(), etc. Functor vs Regular Function: Need of Functor? Imagine we have a function that takes only one argument, like this: int increment(int x) { return x + 1; } Now, what ... Read More

18K+ Views
The void functions are called void because they do not return anything. "A void function cannot return anything" this statement is not always true. From a void function, we cannot return any values, but we can return something other than values. Some of them are like below. A void function can return A void function cannot return any values. But we can use the return statement. It indicates that the function is terminated.ExampleThe following example demonstrates a void function with the return statement: #include using namespace std; void my_func() { cout

1K+ Views
In C++, a pointer stores the address of another variable, which means that the pointer itself does not contain a value of its own. However, you can assign a null value or a 0 to a pointer, in which case the pointer will not point to the address of any other variable. NULL: It is special constant that indicates the pointer does not point to any valid memory location i.e., an Empty Pointer. 0: It is an older way to represent a null pointer to indicate that the pointer points to nothing. nullptr: It is introduced in C++11, it ... Read More

10K+ Views
The size of a pointer in C/C++ is not fixed. It depends upon different issues like Operating system, CPU architecture etc. Usually it depends upon the word size of underlying processor, for example for a 32 bit computer the pointer size can be 4 bytes and for a 64 bit computer the pointer size can be 8 bytes. So for a specific architecture pointer size will be fixed. It is common to all data types like int *, float * etc. Depending on the system architecture, pointer size may vary. The following table shows the pointer size based on the ... Read More

6K+ Views
Stored procedures are sub routines, segment of SQL statements which are stored in SQL catalog. All the applications that can access Relational databases (Java, Python, PHP etc.), can access stored procedures.Stored procedures contain IN and OUT parameters or both. They may return result sets in case you use SELECT statements. Stored procedures can return multiple result sets.Retrieving Results from a procedure:You can call an existing stored procedure using the CallableStatement. The prepareCall() method of the Connection interface accepts the procedure call in string format and returns a callable statement object.CallableStatement cstmt = con.prepareCall("{call sampleProcedure()}");Execute the above created callable statement using ... Read More

1K+ Views
MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on concept of collection and document.Before you start connecting MongoDB in you need to make sure that you have MongoDB JDBC driver. If not, download the jar from the path Download mongo.jar and, add it to your classpath.ExampleFollowing JDBC program establishes connection with the MongoDB database and creates a collection in it.import com.mongodb.client.MongoDatabase; import com.mongodb.MongoClient; import com.mongodb.MongoCredential; public class CreatingCollection { public static void main( String args[] ) { // Creating a Mongo client MongoClient ... Read More

660 Views
In C++, a std::vector is a container that is a part of the STL (Standard Template Library). It enables dynamic arrays which can adjust their size automatically. Depending on the requirements and version of C++ being used, there are many ways to initialize a std::vector with hardcoded elements. Initializing a std::vector with Hardcoded Elements Some of the approaches to initialize a std::vector with hardcoded elements in C++: Using Initializer List Using assign() Function Using accumulate() function Initializing Vector Using Initializer List An initializer list is a ... Read More