Jennifer Nicholas has Published 329 Articles

Pointer vs Array in C

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

390 Views

Pointers and array most of the time are treated as same in c. Some differences are:&operator:&pointer = returns the address of pointer.&array = returns the address of first element.sizeof operator:sizeof(array) = returns the total memory consumed by the all the elements of the array.sizeof(pointer) = returns the only memory consumed ... Read More

Functools — Higher-order functions and operations on callable objects in Python

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

191 Views

Function in Python is said to be of higher order. It means that it can be passed as argument to another function and/or can return other function as well. The functools module provides important utilities for such higher order functions.partial() functionThis function returns a callable 'partial' object. The object itself ... Read More

C program to print a string without any quote in the program

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

628 Views

This is another tricky problem. In this program, we will see how to print a string using C where no quotation marks are used.Here we are using macro function. We are defining a macro function like#define getString(x) #xThe getString() is a macro function. It returns x by converting it into ... Read More

How to create a table in a database using JDBC API?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

5K+ Views

A. You can create a table in a database using the CREATE TABLE query.SyntaxCREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... columnN datatype, PRIMARY KEY( one or more columns ) );To create a table in a database using JDBC API you need to:Register the driver: Register the driver ... Read More

How to implementing START_STICKY for a service?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

1K+ Views

Before getting into an example, we should know what service is in android. Service is going to do back ground operation without interacting with UI and it works even after activity destroy.START_STICKY -  If service is started with START_STICKY return type, it going to work in back ground even if activity ... Read More

Execute both if and else statements simultaneously in C/C++

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

140 Views

In this section we will see how to execute the if and else section simultaneously in a C or C++ code. This solution is little bit tricky.When the if and else are executed one after another then it is like executing statements where if-else are not present. But here we ... Read More

How to update listview after insert values in Android sqlite?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

610 Views

Before getting into an example, we should know what SQLite database in android is. SQLite is an opensource SQL database that stores data to a text file on a device. Android comes in with built-in SQLite database implementation. SQLite supports all the relational database features. In order to access this ... Read More

How to find device is in airplane mode or not in android?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

131 Views

This example demonstrates How to find the device is in airplane mode or not in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. ... Read More

Assertions in C/C++

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

322 Views

Here we will see what is assertions in C/C++. The C library macro void assert(int expression) allows diagnostic information to be written to the standard error file. In other words, it can be used to add diagnostics in your C program.Following is the declaration for assert() Macro.void assert(int expression);The parameter ... Read More

How to use removeAll() in android CopyOnWriteArraySet?

Jennifer Nicholas

Jennifer Nicholas

Updated on 30-Jul-2019 22:30:25

68 Views

Before getting into an example, we should know what CopyOnWriteArraySet is. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrates about How to use removeAll() in android CopyOnWriteArraySetStep 1 − Create a new project ... Read More

Advertisements