- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Smita Kapse has Published 558 Articles
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
921 Views
We have created a button component here, which will places in bottom-right corner −JButton button = new JButton("This is Demo Text!"); button.setBackground(Color.blue); button.setForeground(Color.white);Create panels now to arrange the above created button component in the bottom right −JPanel bottomPanel = new JPanel(new BorderLayout()); bottomPanel.add(button, BorderLayout.LINE_END); JPanel mainPanel = new JPanel(new BorderLayout()); ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
13K+ Views
To get a file’s size in C++ first open the file and seek it to the end. tell() will tell us the current position of the stream, which will be the number of bytes in the file.Example Live Demo#include #include using namespace std; int main() { ifstream in_file("a.txt", ios::binary); ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
197 Views
To reverse array field in MongoDB, you can use forEach(). Let us first create a collection with documents −> db.reverseArrayDemo.insertOne({"Skills":["C", "Java"]}); { "acknowledged" : true, "insertedId" : ObjectId("5ccddf99dceb9a92e6aa1946") }Following is the query to display all documents from a collection with the help of find() method −> db.reverseArrayDemo.find().pretty();This will ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
7K+ Views
In this section, we will see how we can get the size of an integer array in C or C++? The size of int[] is basically counting the number of elements inside that array. To get this we can use the sizeof() operator. If the array name is passed inside ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
98 Views
To set the alignment of the label content along the X axis on the left, use the setHorizontalAlignment() method and set the location. Let us first set a label component. We have set the label background color as well so that we can check the alignment of the label’s content ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
75 Views
For this, use the $all operator. Let us first create a collection with documents −>db.findDocumentExactlySameInArrayDemo.insertOne({"TechnicalSubjects":["C++", "Java", "MongoDB"]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd69a5f57806ebf1256f12e") } >db.findDocumentExactlySameInArrayDemo.insertOne({"TechnicalSubjects":["MySQL", "Java", "MongoDB"]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd69ac057806ebf1256f12f") } >db.findDocumentExactlySameInArrayDemo.insertOne({"TechnicalSubjects":["C#", "Python", "MongoDB"]}); { "acknowledged" : true, "insertedId" ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
6K+ Views
Here is an example of Read integers from a text file with C++ ifstream.Example#include #include using namespace std; int main() { //initialie the array size int arr[30]; ifstream is("a.txt"); int cnt= 0; int x; // check that array is not already full ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
151 Views
Here we will see how to pass reference of some variable in C++. Sometimes we call it as “Call by Reference”.The call by reference method of passing arguments to a function copies the reference of an argument into the formal parameter. Inside the function, the reference is used to access ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
126 Views
To set the alignment of the label’s content along the Y axis on the top, use the setVerticalAlignment() method and set the location. Let us first set a label component. We have set the label background color as well so that we can check the alignment of the label’s content ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
Smita Kapse
1K+ Views
To access array elementsWe can access array elements by using pointers.In CExample Live Demo#include int main() { int a[] = { 60, 70, 20, 40 }; printf("%d", *(a + 1)); return 0; }Output70In C++Example Live Demo#include using namespace std; int main() { int a[] = { 60, 70, 20, 40 }; cout