Nishtha Thakur

Nishtha Thakur

398 Articles Published

Articles by Nishtha Thakur

Page 17 of 40

match max_size() function in C++ STL

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 145 Views

The match max_size() function in C++ STL returns the maximum number of elements in the match_results object that can be held by the match container.This function does not accept a parameter.Example Code#include #include using namespace std; int main() {    match_results m;    cout

Read More

How to convert a std::string to const char* or char* in C++?

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 2K+ Views

In this section, we will see how to convert C++ string (std::string) to const char* or char*. These formats are C style strings. We have a function called c_str(). This will help us to do the task. It returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object.Following is the declaration for std::string::c_str.const char* c_str() const;This function returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object. If an exception is thrown, ...

Read More

Which one is better in between pass by value or pass by reference in C++?

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 609 Views

In C++ we can pass arguments into a function in different ways. These different ways are −Call by ValueCall by ReferenceCall by AddressSometimes the call by address is referred to as call by reference, but they are different in C++. Incall by address, we use pointer variables to send the exact memory address, but in call by reference we pass the reference variable (alias of that variable). This feature is not present in C, there we have to pass the pointer to get that effect.In this section, we will see what are the advantages of call by reference over call ...

Read More

Collectors counting() method in Java 8

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 1K+ Views

The counting() method of the Java 8 Collectors class returns a Collector accepting elements of type T that counts the number of input elements.The syntax is as follows −static Collector counting()Here, the parameter −T − type of input elementsLong − This class value of the primitive type long in an objectTo work with Collectors class in Java, import the following package −import java.util.stream.Collectors;The following is an example to implement counting() method in Java 8 −Exampleimport java.util.stream.Collectors; import java.util.stream.Stream; public class Demo {    public static void main(String[] args) {       Stream stream = Stream.of("25", "50", "75", ...

Read More

Restrictions applied to Java static methods

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 4K+ Views

If the static keyword is applied to any method, it becomes a static method.If a method is declared as static, it is a member of a class rather than belonging to the object of the class. It can be called without creating an object of the class. A static method also has the power to access static data members of the class.There are a few restrictions imposed on a static methodThe static method cannot use non-static data member or invoke non-static method directly.The this and super cannot be used in static context.The static method can access only static type data ...

Read More

Set all list items on a single line with Bootstrap

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 2K+ Views

To set all list items on a single line, use the .list-inline class.You can try to run the following code to implement the .list-inline class −Example           Bootstrap Example                                          Technologies                       Home             PHP             Java             jQuery             JavaScript             Ruby                    

Read More

Create Default Bootstrap Navbar

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 607 Views

Follow the below given steps in Bootstrap to create default navbar −Add the classes .navbar, .navbar-default to the tag.Add role = "navigation" to the above element, to help with accessibility.Add a header class .navbar-header to the element. Include an element with class navbar-brand. This will give the text a slightly larger size.To add links to the navbar, simply add an unordered list with the classes of .nav, .navbar-nav.You can try to run the following code to create default navbar −Example           Bootstrap Example                                                       Cars                                                BMW                Audi                                                   SUV                                                                     Creta                   Scorpio                                                                

Read More

Bootstrap danger Contextual class

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 258 Views

The Bootstrap danger contextual class indicates a danger action.You can try to run the following code to implement the .danger class −Example           Bootstrap Table                                                                      Subject                Marks                Student                                                            Programming                90                Amit                                         Web Dev                 92                 Yuvraj                                        Science                95                Sachin                                        Economics                80                Tony                                

Read More

Create a progress bar with Bootstrap

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 508 Views

To create a basic progress bar in Bootstrap, use the .progress and .progress-bar class.You can try to run the following code to form a progress bar −Example           Bootstrap Example                                                       60% Complete                    

Read More

Filter table with Bootstrap

Nishtha Thakur
Nishtha Thakur
Updated on 11-Mar-2026 3K+ Views

To filter a table in Bootstrap, you can try to run the following code −Example           Bootstrap Example                                          Students Rank                                                                          Name                Marks                Rank                                                                           Amit                   94                   1                                                   Tom                   90                   2                                                   Steve                   88                   3                                                   Chris                   80                   4                                                   Corey                   79                   5                                                   Glenn                   75                   6                                                            $(document).ready(function(){             $("#demo").on("keyup", function() {                var value = $(this).val().toLowerCase();                $("#test tr").filter(function() {                   $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)                });             });          });          

Read More
Showing 161–170 of 398 articles
« Prev 1 15 16 17 18 19 40 Next »
Advertisements