Vrundesha Joshi has Published 343 Articles

_Noreturn function specifier in C

Vrundesha Joshi

Vrundesha Joshi

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

133 Views

The _Noreturn function specifier is used to tell to the compiler that the function will not return anything. If the program uses some return statement inside it, the compiler will generate compile time error.Example Code#include main() {    printf("The returned value: %d", function); } char function() {    return 'T'; ... Read More

How to get current state of activity in android?

Vrundesha Joshi

Vrundesha Joshi

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

580 Views

This example demonstrates How to get current state of activity 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.     In the ... Read More

Sum of array using pointer arithmetic in C++

Vrundesha Joshi

Vrundesha Joshi

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

3K+ Views

This is a C++ program to find out sum of array elements using pointer.AlgorithmBegin    Initialize the array elements with values from user input.    Initialize s = 0    Loop for i = 0 to       s = s + *(ptr + i)    Print the sum ... Read More

Callbacks in C

Vrundesha Joshi

Vrundesha Joshi

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

2K+ Views

The callback is basically any executable code that is passed as an argument to other code, that is expected to call back or execute the argument at a given time. We can define it in other words like this: If the reference of a function is passed to another function ... Read More

How to get launcher thumbnail size in android?

Vrundesha Joshi

Vrundesha Joshi

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

87 Views

This example demonstrates How to get launcher thumbnail size 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. In ... Read More

What does the operation c=a+++b mean in C/C++?

Vrundesha Joshi

Vrundesha Joshi

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

1K+ Views

Let us consider in C or C++, there is a statement like:c = a+++b;Then what is the meaning of this line?Well, Let the a and b are holding 2 and 5 respectively. this expression can be taken as two different types.c = (a++) + bc = a + (++b)There are ... Read More

How to set minimum capacity for arraylist Listview in Android?

Vrundesha Joshi

Vrundesha Joshi

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

81 Views

This example demonstrates How to set minimum capacity for arraylist Listview 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

How to print dimensions of multidimensional array in C++

Vrundesha Joshi

Vrundesha Joshi

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

146 Views

Here is a C++ program to print dimensions of given array.AlgorithmHere template() function is used to find out the current size of array. Then recursively call it till the last dimension of array.Example Code Live Demo#include using namespace std; template void printDimensionsOfArray(const t (&a)[n]) {    cout Read More

Function overloading and return type in C++

Vrundesha Joshi

Vrundesha Joshi

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

2K+ Views

You can have multiple definitions for the same function name in the same scope. The definition of the function must differ from each other by the types and/or the number of arguments in the argument list. You cannot overload function declarations that differ only by return type.The function overloading is ... Read More

Android scan wifi networks programmatically

Vrundesha Joshi

Vrundesha Joshi

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

2K+ Views

This example demonstrate about How to scan wifi networks programmatically.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.         Step 3 ... Read More

Advertisements