Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

Search In

Dynamic Memory Allocation using malloc() in C

The malloc is an acronym of "memory allocation". This function allocates the requested size of bytes to a variable and return a pointer of type void. Syntax: p=(type cast *)malloc(size) Here p is a pointer. Example: Calculate the sum to element

How to get all month names in the current locale in Rails

There are number of ways to get the names of the all the months in the current locale. I am using the Ruby I18n gem which comes along with Rails. This gem provides number of methods to perform these localisation tasks. To get the month names you

PASSING ARGUMENT TO A FUNCTION BY VALUE IN C

Passing argument to a function by value is also know as call by value. This method of passing arguments to a function copies the original value of argument into the formal parameter of a function. In other words if we change parameter which are give

PASSING ARGUMENT TO A FUNCTION BY REFERENCE IN C

Passing argument to a function by reference is also know as call by reference. In this method if we change the parameter given in the function will effect the argument. For passing a value by reference, we use pointers. As we use pointers in call b

:nth-child in css

The :nth-child selector in CSS code is here it will allow you to select one or more elements according to the formula. It is used to style content based on parent and child relationship. :nth-child iterates throughs elements from the top of the p

how to show nearest famous places to user location in maps

how to show nearest famous places to user location in maps in 50 miles or 100 miles etc.. i was lot searching in google'n but i can't find it could any one help me

Efficient method to find maximum difference between two elements in C?

#include<stdio.h> int maxDiff(int a[], int n) { int maxDiff = -1; // Initialize Result int maxRight = a[n-1]; // Initialize max element from right side for (int i = n-2; i >= 0; i--) { if (a[i] > maxRight)

Program to count no of words from given input string.

// C++ program to count no of words from given input string. #include <stdio.h> #define separator 0 #define word 1 unsigned countWords(char *str) // returns number of words in str { int state = separator; unsigned wc = 0; // word count w

How to check whether a number is in range[low,high] using one comparison?

#include <iostream> using namespace std; // Returns true if x is in range [low..high], else false bool inRange(int low, int high, int x) { return ((x-high)*(x-low) <= 0); } int main() { inRange(10, 100, 25)? cout << "Yes\n":

Main Thread in java

Main Thread: When we run a Java program  then main thread begins running immediately. It is created automatically. The main thread is the first as well as last thread in a java program to end. It is the main thread from which other child threa

1 13 156
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: